У меня есть макет с BottomNavigationView
с атрибутом app:labelVisibilityMode
, установленным на labeled
:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:labelVisibilityMode="labeled"
app:menu="@menu/navigation" />
</FrameLayout>
Меню состоит из пяти пунктов:
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/navigation_home"
android:icon="@drawable/ic_navigation"
android:title="Short" />
<item
android:id="@+id/navigation_notifications_1"
android:icon="@drawable/ic_navigation"
android:title="Short" />
<item
android:id="@+id/navigation_dashboard"
android:icon="@drawable/ic_navigation"
android:title="Longer text123" />
<item
android:id="@+id/navigation_notifications_2"
android:icon="@drawable/ic_navigation"
android:title="Short" />
<item
android:id="@+id/navigation_notifications_3"
android:icon="@drawable/ic_navigation"
android:title="Short" />
</menu>
Есть проблемас третьим элементом с более длинной меткой ("Longer text123"
) - второе слово не имеет эллипсиса, а просто не отображается:
![enter image description here](https://i.stack.imgur.com/OcC5v.png)
Создание меткинемного короче вызывает правильное поведение:
![enter image description here](https://i.stack.imgur.com/u0CJA.png)
Есть ли способ обработки более длинных этикеток?Лучшим решением было бы сделать его эллиптическим и отобразить «Более длинный текст ...», когда нет места для всего текста.