SNM
SNM

Reputation: 6835

Bottom nav not alligning to bottom

I have succefully made a bottomNavigation but when I execute my code it appears to be at the top instead as at the bottom of the screen, do I need to do something else?

@Composable
fun BottomNavWithLabels(){
    BottomNavigation(content = {
        listItems.forEachIndexed { index, label ->
            BottomNavigationItem(
                    icon = {
                                Icon(vectorResource(id = R.drawable.ic_baseline_home_24))
                          
            )
        }
    })
}

Upvotes: 1

Views: 108

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 364868

You can use your BottomNavWithLabels() with a Scaffold:

Scaffold(topBar = { },
        bottomBar = {
            BottomNavWithLabels()
        },
        bodyContent = {
    //bodyContent()
})

enter image description here

Upvotes: 2

Related Questions