Skip to content
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

How to set the actionbar functionalities using the TabNavigation? #389

Open
andretietz opened this issue Apr 8, 2024 · 0 comments
Open
Labels
question Further information is requested

Comments

@andretietz
Copy link

Hey!

I am struggeling to find a solution for setting the actionbar title and backbutton functionality, when using the TabNavigation.

I am using the TabNavigation like so:

TabNavigator(Tab1) { nav ->
    Scaffold(
        topBar = {
            TopAppBar(
                title = { Text(nav.current.options.title) },
            )
        },
        modifier = Modifier
            .fillMaxSize(),
        bottomBar = {
            NavigationBar {
                TabNavigationItem(Tab1)
                TabNavigationItem(Tab2)
                TabNavigationItem(Tab3)
                TabNavigationItem(SettingsTab)
            }
        },
        content = { CurrentTab() },
    )
}

Every Tab has it's own navigation stack. I would like to see that every Screen can set it's own title (not just the tab as I am doing in the code right now). Also important is setting a Back button functionality, which is also very dependent on which Screen I am at.

Is there a common pattern for that already? If so, I didn't find it yet.

@andretietz andretietz changed the title How to set the actionbar title using the TabNavigation? How to set the actionbar functionalities using the TabNavigation? Apr 8, 2024
@DevSrSouza DevSrSouza added the question Further information is requested label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants