0
我是一名Android新手,寫過我的第一款使用操作欄和設計支持庫的應用程序。但是,當我展開菜單時,它具有黑色背景色。在應用材料設計之前,菜單具有默認的灰色。我的colors.xml文件中沒有任何深色。我怎樣才能恢復正常的顏色? 下面是我在styles.xml創建的主題:在api上更改材質設計的菜單背景顏色8
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textColorPrimary">@color/textColorPrimary</item>
<item name="android:textColorSecondary">@color/textColorSecondary</item>
</style>
當我刪除應用主題我的工具欄,我得到的正常顏色恢復正常,但操作欄的文字和的3點垂直圓點的顏色發生變化變黑。以下是我的activity_main的相關部分:
<LinearLayout 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:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
</LinearLayout>
只是爲了確定,你是否將你的主題添加到Android清單? –
@AbdullahAsendar:是的。 Apptheme是默認的清單主題。我用我自己的設置覆蓋了現有的主題。 – user1801060
這可能不會幫助,但嘗試將父級更改爲父=「Theme.AppCompat.Light.DarkActionBar」 –