Replies: 3 comments 3 replies
-
I guess that depends on how you would like your settings screen to be displayed. Should it be shown above the TabBar and hide it or should the TabBar stay visible? (This should definitely work. I use this pattern in my app) flowchart LR
RootStackLayout --> TabLayout
TabLayout --> TabA
TabLayout --> TabB
TabLayout --> TabC
RootStackLayout --> SettingsPage
This way you can navigate (router.push) to the settings from each screen and pressing back will navigate to the previously open tab. (This is theory from reading the docs, but should probably work)
If it will be shown as a tab inside the TabLayout (I am not sure if it will), you can hide it as described here: |
Beta Was this translation helpful? Give feedback.
-
@vitalyliber What if I want to access the events page from the settings tab too? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
There seem to be a lot of confusion and no documentation/examples on how to achieve a main Tab-ed view and being able to navigate to a Stack from with a Tab and then go back to the Tab you came from. Many people ask this question in Discord without progress and since this is a very common navigation design I thought about posting it here.
Here is the navigation architecture:
App has three tabs on the initial screen (Tab A | Tab B | Tab C)
User lands on
Tab A
by default. Then navigates to a Stack (lets say profile screen, could be shared by multiple tabs)Where and how should the profile Stack live? Nesting a Stack inside a Tab is regarded as an extra tab. Pulling the Stack outside of the Tabs seems to result in worse performance.
What is the correct approach to embed a Stack inside a Tab? or is embedding a Stack inside a Tab not recommended?
Here is an example folder structure:
profile/index appears as an extra tab so this is not ideal.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions