但是我收到以下错误:
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
我的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
解决方法 找到答案: https://medium.com/@chrisbanes/appcompat-v23-2-age-of-the-vectors-91cbafa87c88#.adypg3azuUpdate Android Support Library to 23.2.0 cause error: XmlPullParserException Binary XML file line #17<vector> tag requires viewportWidth > 0
似乎更新到支持库23.2.0将导致此问题
对于那些不想提供更多详细信息的人,您只需要执行以下 *** 作:
如果您有Gradle 2.0或更高版本:
androID { defaultConfig { vectorDrawables.useSupportlibrary = true }}
或者如果你有1.5或更低版本:
androID { defaultConfig { // Stops the Gradle plugin’s automatic rasterization of vectors generatedDensitIEs = [] } // Flag to tell aapt to keep the attribute IDs around aaptoptions { additionalParameters "--no-version-vectors" }}总结
以上是内存溢出为你收集整理的android – 无法在pre L设备上充气工具栏全部内容,希望文章能够帮你解决android – 无法在pre L设备上充气工具栏所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)