How to set bottom nav bar items centred for landsc...
# android
n
How to set bottom nav bar items centred for landscape or tablet mode. They're too far apart. (Jetpack compose)
😶 1
i
You shouldn't be using a bottom nav bar on those devices at all - that's why there is a Navigation Rail component
👍 1
n
Can you set Navigation Rails to be at the bottom?
i
That would defeat the entire purpose of swapping out a bottom bar, which only makes sense on portrait mode phones where the vertical space is much higher than the horizontal space, for a layout which was purposely built specifically for devices with a wider width where having a bar stretching across the entire screen was always an anti-pattern
n
I totally understand your point but the requirement is to have bottom nav on both portrait mode phone or wider screen like tablets. Was wondering if there's a way around to this. Thanks
i
I'd point whoever wrote that requirement to the Large Screen landing page (https://developer.android.com/large-screens) and the Material guidelines for adaptive design (https://m3.material.io/foundations/adaptive-design/overview) and specifically the Layout anatomy page (https://m3.material.io/foundations/adaptive-design/large-screens/layout-anatomy), none of which will ever have a bottom nav on wider screens since it is simply the wrong choice and always has been 🙂
Hopefully copious amounts of design and developer guidance will be enough to convince them that asking about centering icons in a bottom nav is a good example of an XY Problem: https://xyproblem.info/
❤️ 1
n
I've already suggested that but they want a custom fix for now. Thanks anyways.
a
I’d be really curious to hear more about the pushback you’re hearing around using a nav rail instead, if you can share more. If you were to center the items in a nav bar, that would still likely be harder to reach on larger devices. Some more resources available in this area: https://android-developers.googleblog.com/2022/11/reach-your-users-on-large-screens.html

https://youtu.be/m7OL-mVh1E8?t=570