【发布时间】:2015-01-15 01:02:21
【问题描述】:
我正在尝试使用具有自定义样式的 android 21 中的工具栏小部件,但我无法摆脱此错误:
Failed to find style 'toolbarStyle' in current theme。
这是我的布局 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" />
这里是患者主题:
<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,但我不知道可能的值。我错过了什么吗?
【问题讨论】:
标签: android android-theme material-design