12-30-2017 15:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-30-2017 15:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I couldn't find any information in the documentation about making an app that has more than one screen. Is this something that is possible? Can you have multiple .gui files for each different view? How are you guys accomplishing this?
Thanks!
Answered! Go to the Best Answer.

Accepted Solutions
12-30-2017 16:06
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-30-2017 16:06
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-30-2017 17:40 - edited 12-30-2017 19:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-30-2017 17:40 - edited 12-30-2017 19:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Yes, you can do it. Here's how index.gui of my app looks like.
<svg> <link rel="import" href="loading/index.gui" /> <link rel="import" href="history-view.gui" /> <link rel="import" href="radar-view.gui" /> <link rel="import" href="fields-view.gui" /> </svg>
In each of view.gui file, you put `display="none"` to the root tag and then switch the screens manipulating with the root.style.diplay.
This, in fact, is exactly what this small library does. It implements hierarchical subviews pattern, helping you to control the mess you'll have when there will be many views in your code. https://github.com/gaperton/ionic-views#class-application
04-18-2020 05:44 - edited 04-18-2020 05:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-18-2020 05:44 - edited 04-18-2020 05:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
In case someone stumbles onto this thread, like I did, some clarification.
allyann's link is discussing a more complex topic but does give a good example of how to switch between multiple screens, it lacks an explanation about how to set them up in the first place.
Start with gaperton's answer first. Once the screens are set up, then you can look at allyann's link for how to go from one to the other.
An important note (you'll see this discussed in the thread that allyann linked to), there are two ways to hide/show screens; display="none"/"inline" and visibility="hidden"/"visible".
These two act in different ways and can affect how your app functions. Take a look at https://www.lifewire.com/display-none-vs-visibility-hidden-3466884 for a good discussion of the difference and how it can affect your app's behaviour.
04-25-2020 15:30 - edited 04-25-2020 15:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-25-2020 15:30 - edited 04-25-2020 15:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I've written a small module to manage different views and navigation between them and passing data.
Take a look at https://github.com/SergioMorchon/fitbit-views
You can see a working example here: https://github.com/SergioMorchon/fitbit-geolocator/tree/master/app
It worth it to say that Fitbit introduced a new `document.replaceSync` function to load on demand the GUI files, and that module I posted above takes advantage of that.

