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是的,我做到了。 –