我有一个让我很沮丧的问题。我无法走到尽头。我的Android应用工具栏中溢出菜单中的菜单项未正确突出显示。也就是说,当按下按钮时,只有文本外部的背景会改变颜色,而文本后面的背景则不会。这是一个截图: http://imgur.com/gqE9xbl 我已经找到了这个确切问题的问题,但没有答案。请帮我。 问候, 亚历山大
UPDATE 这是我的样式和工具栏的来源:
<style name="BaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/converterColorPrimary</item>
<item name="colorPrimaryDark">@color/converterColorPrimaryDark</item>
<item name="colorAccent">@color/converterColorAccent</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@color/converterWindowBackground</item>
<item name="android:textColor">@color/converterWindowTextColor</item>
<item name="colorControlNormal">@color/converterControlColorNormal</item>
<item name="colorControlHighlight">@color/converterColorControlHighlight</item>
</style>
<style name="AppTheme" parent="BaseTheme"/>
<style name="ToolbarThemeOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:background">@color/converterColorPrimary</item>
<item name="android:textColorPrimary">@color/converterToolbarTextColorPrimary</item>
</style>
<style name="ToolbarPopupTheme" parent="ThemeOverlay.AppCompat.Light">
<item name="android:background">@color/converterWindowBackground</item>
<item name="android:textColorPrimary">@color/converterWindowTextColor</item>
</style>
<style name="ToolbarTitleTextAppearance" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">@color/converterToolbarTextColorPrimary</item>
<item name="android:textSize">18sp</item>
</style>
工具栏:
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:converter="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:id="@+id/app_bar"
converter:theme="@style/ToolbarThemeOverlay"
converter:popupTheme="@style/ToolbarPopupTheme"
converter:titleTextAppearance="@style/ToolbarTitleTextAppearance"/>