Tôi đang cố sử dụng tiện ích thanh công cụ trong android 21 với kiểu tùy chỉnh nhưng tôi không thể loại bỏ lỗi này: Failed to find style 'toolbarStyle' in current theme
.Android Material Design: Không thể tìm thấy kiểu 'toolbarStyle' trong chủ đề hiện tại
Dưới đây là cách bố trí file xml của tôi:
<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" />
Dưới đây là chủ đề Bệnh nhân:
<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>
Tôi cũng cố gắng thêm toolbarStyle
trong mục trong chủ đề của tôi nhưng tôi don' t biết các giá trị có thể. Tui bỏ lỡ điều gì vậy?
Thêm vào đó, Bạn có thể sử dụng @android: phong cách cho bất kỳ phong cách mà bạn đang dựa chủ đề của bạn từ- @ phong cách <- - phong cách Toolbar!> /Widget.AppCompat.Toolbar
–
OYRM