Android BottomNavigationView невыделенный текст не отображается

Я использую android.support.design.widget.BottomNavigationView. Все в порядке, за исключением того, что заголовки не отображаются, когда они не выбраны.

Android BottomNavigationView невыделенный текст не отображается

<!-- layout -->
<android.support.design.widget.BottomNavigationView
    android:id = "@+id/bnvBar"
    android:layout_width = "match_parent"
    android:layout_height = "wrap_content"
    android:layout_alignParentBottom = "true"
    android:background = "@android:color/background_light"
    android:theme = "@style/BottomNavigationTheme"
    app:menu = "@menu/bottom_navigation_main" />

<!-- theme -->
<style name = "BottomNavigationTheme" parent = "Theme.AppCompat.Light">
    <item name = "colorPrimary">@color/orange</item>
</style>

Чего не хватает?

проверьте это--> stackoverflow.com/questions/41718633/…

Swati 22.01.2019 05:51

попробуйте это - bottomNavigationView.setLabelVisibilityMode(LabelVisibilityM‌​ode.LABEL_VISIBILITY‌​_LABELED) @Sean

Dhanshri 22.01.2019 05:59
14
2
5 561
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

Если вы используете библиотеку поддержки 28 Попробуйте это,

app:labelVisibilityMode = "labeled"

Полный код

    <android.support.design.widget.BottomNavigationView
        android:id = "@+id/bnvBar"
        android:layout_width = "match_parent"
        android:layout_height = "wrap_content"
        android:layout_alignParentBottom = "true"
        android:background = "@android:color/background_light"
        android:theme = "@style/BottomNavigationTheme"
        app:menu = "@menu/bottom_navigation_main" 
        app:labelVisibilityMode = "labeled"
    />

Другие вопросы по теме