【发布时间】:2015-08-04 09:00:46
【问题描述】:
我正在使用以下代码添加带有 PreferenceActivity 的工具栏:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/actionbar_color"
android:minHeight="?attr/actionBarSize"
android:paddingTop="0dp"
app:navigationContentDescription="@string/abc_action_bar_up_description"
app:navigationIcon="?attr/homeAsUpIndicator"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/Base.ThemeOverlay.AppCompat.Dark.ActionBar" />
代码片段:
LinearLayout root = (LinearLayout) findViewById(android.R.id.list).getParent().getParent().getParent();
Toolbar bar = (Toolbar) LayoutInflater.from(this).inflate(R.layout.app_bar_settings, root, false);
root.addView(bar, 0); // insert at top
使用 PreferenceActivity 成功显示工具栏
但是根据我的主题app:theme="@style/Base.ThemeOverlay.AppCompat.Dark.ActionBar,操作栏向上箭头、标题和操作溢出按钮是黑色的
这些应该是白色的。我该如何解决这个问题。
【问题讨论】:
标签: android android-theme android-toolbar