Подтвердить что ты не робот

Android Material Design: Не удалось найти стиль "toolbarStyle" в текущей теме

Я пытаюсь использовать виджет панели инструментов в 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 в элемент в моей теме, но я не знаю возможных значений. Я что-то упускаю?

4b9b3361

Ответ 1

Вы можете использовать стиль Widget.AppCompat.Toolbar.

<!-- Toolbar styles -->
    <item name="toolbarStyle">@style/Widget.AppCompat.Toolbar</item>

Ответ 2

У меня было такое же проблемное событие, хотя мой xml был прав. Решение было: Установить тему AppCompat в флажке выбора темы, см. Рис. enter image description here