Элементы меню Android не отображаются с помощью темы `Theme.MaterialComponents.Light.NoActionBar` - PullRequest
0 голосов
/ 30 марта 2019

Создание простого приложения с переполнением меню.Меню переполнения отображается нормально, однако фактические элементы меню не видны.Тема имеет текущее значение Theme.MaterialComponents.Light.NoActionBar.

Screenshot

Но когда я переключаю тему на Theme.MaterialComponents.NoActionBar, она работает просто отлично:

Screeneshot 2

Вот menu.xml:


<menu xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- TODO Step 9.1 - Add an item for the settings fragment -->

    <item android:id="@+id/settings_dest"
          android:icon="@drawable/ic_settings"
          android:menuCategory="secondary"
          android:title="@string/settings"
          android:visible="true"
          android:enabled="true"
          app:showAsAction="never|withText"/>

    <item android:id="@+id/settings_second"
          android:icon="@drawable/ic_settings"
          android:menuCategory="secondary"
          android:title="Second"
          android:visible="true" android:enabled="true" android:checkable="true"/>

    <!-- TODO END STEP 9.1 -->
</menu>

И style.xml:

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.MaterialComponents.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name = "actionMenuTextColor">@color/colorBlack</item>
    </style>

Любые предложения

...