如果使用主题为的新工具栏,则Theme.AppCompat.Light.NoActionBar可以通过以下方式设置样式。
@color/my_color1
@color/my_color2
@color/my_color3
`
根据我得到的结果,
android:textColorPrimary是显示活动名称的文本颜色,这是工具栏的主要文本。
android:textColorSecondary是字幕和更多选项(3点)按钮的文本颜色。(是的,它根据此属性更改了颜色!)
android:textColor是包括菜单在内的所有其他文本的颜色。
最后将主题设置为工具栏
xmlns:app="http://schemas.android.com/apk/res-auto"
app:theme="@style/ToolbarTheme"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"/>