robnik
08/17/2021, 10:37 PMText
to stay centered when it overflows. My label in BottomNavigationItem
is overflowing a bit, but going off-center to the right. Image in thread.robnik
08/17/2021, 10:38 PMrobnik
08/17/2021, 10:39 PMBottomNavigationItem(
icon = { Icon(item.icon, contentDescription = null) },
label = {
Text(item.name, maxLines = 1, textAlign = TextAlign.Center,
overflow = TextOverflow.Visible, softWrap = false)
},
Chris Sinco [G]
08/17/2021, 10:45 PMrobnik
08/18/2021, 1:20 PMModifier.offset(-6.dp)
but obviously that's fugly and won't work for different screens.Louis Pullen-Freilich [G]
08/18/2021, 1:55 PMBottomNavigationItem
at the start and end that constrains the size of the text (you can see in the image the bounds of the text, and how the ‘s’ at the end is drawing outside of it. If the text is bigger (such as translated text in a different language, or maybe the user has increased the overall font scaling of the device) then the text will have no choice but to draw outside of the item, which is probably not what is intended here.
If you really want to ignore the default padding so there is more space for text, I would suggest instead creating your own implementation of BottomNavigationItem
instead, this isn’t really supported and there isn’t a nice way of handling this without just having more space for the text in the first placerobnik
08/18/2021, 2:08 PMLouis Pullen-Freilich [G]
08/18/2021, 2:11 PM