我正在嘗試在預L設備上膨脹toolbar
。我使用了一個擴展爲Theme.AppCompat.Light
的主題,因此屬性如下:?attr/actionBarSize
應該可以工作。無法在預L設備上對工具欄充氣
但是我收到以下錯誤:
Error inflating class android.support.v7.widget.Toolbar
Caused by: android.content.res.Resources$NotFoundException: File res/drawable-v19/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020016
我toolbar
從XML
是這樣的:
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/material_drawer_primary"
android:minHeight="?attr/actionBarSize"
android:theme="@style/****"
app:popupTheme="@style/****"
app:contentInsetStart="72dp"/>
,我的主題是:
<style name="****" parent="Theme.AppCompat.Light">
<!-- ...and here we setting appcompat’s color theming attrs -->
<item name="colorPrimary">@color/material_drawer_primary</item>
<item name="colorPrimaryDark">@color/material_drawer_primary_dark</item>
<item name="colorAccent">@color/material_drawer_accent</item>
<!-- MaterialDrawer specific values -->
<item name="material_drawer_background">@color/material_drawer_background</item>
<item name="material_drawer_primary_text">@color/material_drawer_primary_text</item>
<item name="material_drawer_primary_icon">@color/material_drawer_primary_icon</item>
<item name="material_drawer_secondary_text">@color/material_drawer_secondary_text</item>
<item name="material_drawer_hint_text">@color/material_drawer_hint_text</item>
<item name="material_drawer_divider">@color/material_drawer_divider</item>
<item name="material_drawer_selected">@color/material_drawer_selected</item>
<item name="material_drawer_selected_text">@color/material_drawer_selected_text</item>
<item name="material_drawer_header_selection_text">@color/material_drawer_header_selection_text</item>
</style>
是否有辦法我該如何解決這個問題?謝謝 !
EDIT1:我也試圖與Theme.AppCompat.Light.NoActionBar