我正在尝试在Android 21中使用工具栏小部件,并使用自定义样式,但是我无法摆脱这个错误:在当前主题中未找到样式“toolbarStyle”
。
这是我的布局XML文件:
<android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/patient_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:theme="@style/AppTheme.Patient" />
以下是Patient主题:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
</style>
<style name="AppTheme.Patient" parent="AppTheme">
<item name="colorPrimary">@color/patient_primary</item>
<item name="colorPrimaryDark">@color/patient_primary_dark</item>
<item name="colorAccent">@color/patient_accent</item>
<item name="toolbarStyle"></item> <!-- what values to put here -->
</style>
我也尝试在我的主题中的项目中添加toolbarStyle
,但是我不知道可能的值。我错过了什么吗?
tools:context
标签,这个标签可以帮助预览选择正确的主题。请参阅https://dev59.com/yWgu5IYBdhLWcg3wxZ3d - loeschg