看完this answer后,我制作了RecyclerView在Android 3.0+上运行。但在values-v21
中的styles.xml
仍然会导致错误。找不到符合指定名称的资源'android:Theme.Material'
主题。
<!-- inherit from the material theme -->
<style name="AppTheme" parent="android:Theme.Material">
<!-- Main theme colors -->
<!-- your app's branding color (for the app bar) -->
<item name="android:colorPrimary">#f00</item>
<!-- darker variant of colorPrimary (for status bar, contextual app bars) -->
<item name="android:colorPrimaryDark">#0f0</item>
<!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">#00f</item>
</style>
错误。
Error:Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material'.
我需要从Android 3.0.x(API级别11)支持Android版本。 <uses-sdk android:minSdkVersion="L" android:targetSdkVersion="L" />
不是一个解决方案。
android.Theme.Material requires API level 21(current min is 14)
在两个不同的文件夹中有两个不同的style.xml文件。值-V20和值 – hoomi 2014-09-05 14:45:04
@hoomi,我已经有'values'和'values-v21'。 'android:Theme.Material'会导致错误。 – 2014-09-05 14:52:57
android:Theme.Material仅支持API级别20. – Psypher 2014-09-05 14:57:45