-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When i push to new screen, tabbar disappears. #78
Comments
In SwiftUI, you determine this behavior by putting the NavigationStack inside or outside of the TabView. This is the same behavior for using native NavigationStack or RouterView...
|
Thanks for quick response , i will check this |
I think after IOS 18, this problem appeared. I tested your code, it does not work. But this case worked before IOS 18, did you test your code in any project |
Problem is on showScreen(.push) it does not work correctly |
Can you provide sample code example that does not work? |
there are a lot of codes. I found problem, problem is when i put RouterView { router in problem occur. But when i use
it works. I dont understand, why? |
After 16 hours of testing all cases. i found how to solve. RouterView(addNavigationView: false) { router in this solved problem. |
That's explained in the ReadMe if you want some background... That means you probably still have NavigationStack in your code. If you delete your NavigationStack and use only RouterView, you won't need to set addNavigationView: false. |
But i only use RouterView. |
Check your whole codebase for NavigationStack? If you link the repo I can look. |
i search for NavigationStack, but nothing is found. Repo is private and belong to company. But i never use NavigationStack , i only use your library. I think problem is nested RouterView . Becuase in TabView i have 4 view with RouterView. And when i put TabsView(viewModel: TabsViewModel()) inside RouterView. Problem appeared. I think problem is nested RouterView |
You should only have 1 RouterView per view hierarchy, there would be no need to add a 2nd. If you did, then I guess you can set addNavigationView: false but it shouldn't be necessary to add. |
Without |
But i have add button in tab, and i show AddNewPost view, from TabsView(viewModel: TabsViewModel())'s router. And I have other four tabs in tabview. when is set this addNavigationView to false , add dont work. when dont set , tabbar cant disappear. i start to search new solution for this. Do you have an idea for that? |
Sorry, I can't tell what the problem is without seeing the code. I've built many MVVM apps using this so there must be something unique to your setup. I would start by only having 1 RouterView per view hierarchy. |
I use fullscreencover for add button in tabview. Thanks for help) |
@SwiftfulThinking Hi again, when i user showModal it did not overlay tabbar, the modal start after tabbar , example: fullScreenCover overlay tabbar. How to achieve this in showModal? |
I have the same issue, tabbar is disappearing when pushing with:
|
@qsd-faris That is not an issue, it is how the NavigationStack works by design. As I said above, you can implement a separate NavigationStack on each tab if you prefer. It would look closer to this: TabView {
RouterView { _ in
BookListView()
}
RouterView { _ in
FavoritesView()
}
RouterView { _ in
SettingsView()
}
} |
Tabbar is only shown in first screen, i dont hide tabbar, but when push tabbar stay on old screen, does not cross to new screen. Anyone face that problem?
The text was updated successfully, but these errors were encountered: