material-components / material-components/material-components-android

[BottomNavigationView] Bottom Navigation View Sizing

Offen
#431 13 Kommentare 1 Reaktion 1 zugewiesene Person Auf GitHub ansehen

@hunterstich arbeitet bereits daran.

Seit 17.5.2022.

bug Widget: BottomNavigation
Vorherrschende Sprache
Java
Sterne
17.4k
Forks
3.2k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

In order to try to keep consistency across devices densities I use Smallest Width folders.
For the BottomNavigationView I set a height of 56dp, an itemIconSize of 24dp and a textSize of 12sp.
In order to test it I change the Smallest Width Available in my device, as I the sw size, the bnb overlaps the icon with the text, seems like the parent view of each item is not resizing accordingly as you can see from the screenshot with "Show Layout Bounds" enabled, while the icon and text sizes looks I expect.
In the screenshot I'm using:

  • sw360dp as a baseline:
    • bnb height: 56dp
    • icon: 24dp
    • text size: 12sp
  • sw480dp:
    • bnb height: 74.67dp
    • icon: 32dp
    • text size: 16sp
  • sw720dp:
    • bnb height: 112dp
    • icon: 48dp
    • text size: 24sp

Is there anyway to access the design_bottom_navigation_item to modify its layout params? as by looking a the screenshots, seems like it has a fixed height, that causes the icon/text overlaping.

or how can I avoid this?

bnb_gh

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.