0
我試圖做一個淡藍色的工具欄用白色文本:工具欄風格不工作
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
style="@style/ToolbarStyle"/>
,並在我的styles.xml:
<style name="ToolbarStyle" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:background">?attr/colorPrimary</item>
</style>
但是有一個問題,文本顏色爲黑色,而不是白色
注:使用android:theme
或app:theme
代替style
將解決這個proble米,但我仍然想知道,爲什麼不style
工作?
您是否在您的活動中使用了setSupprtActionBar(mToolBar)? –
@KrupalShah是的,我做到了。 –