我有一个应用程序Theme.AppCompat.Light,我需要使用它,所以Dialogs有轻主题.但这会使我的工具栏中的文字变黑,我宁愿它变成白色.我试过设置工具栏的具体app:theme到AppCompat.Dark.Actionbar,但没有运气...我搜索了一段时间,但没有找到一个具体的问题和答案.
这是我的默认AppTheme:
<style name="AppTheme.Parent" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/blue</item>
<item name="colorPrimaryDark">@color/dark_blue</item>
<item name="colorAccent">@color/pink</item>
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
</style>
Run Code Online (Sandbox Code Playgroud)
这是我的toolbar.xml:
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="@dimen/abc_action_bar_default_height_material"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
Run Code Online (Sandbox Code Playgroud)