简体   繁体   English

错误:检索父项时出错:找不到与给定名称'android:Theme.Holo.Light.DarkActionBar'匹配的资源

[英]error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'

I saw a lot of related post in stackoverflow about this message, but it didn't answer my doubts. 我在stackoverflow中看到了很多有关此消息的相关文章,但是它并没有回答我的疑问。

In the manifest.xml, I have : 在manifest.xml中,我有:

    <uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="19" />

So in the posts, they say because my minSdkVersion is 9, I can't use Theme.Holo.Light.DarkActionBar. 所以在帖子中,他们说,因为我的minSdkVersion是9,所以我不能使用Theme.Holo.Light.DarkActionBar。

But it is a nonsense because the default folder values-v14 is only for API 14+ users... 但这是胡说八道,因为默认文件夹值-v14仅适用于API 14+用户...

So why do I get this error, I want to maintain my android:minSdkVersion = 9. It should be possible no??? 那么,为什么会出现此错误,我想维护我的android:minSdkVersion =9。应该不会吗???

I think you are confused between the resource folder system and the actual Android version range in which your app is supported. 我认为您在资源文件夹系统和支持您的应用的实际Android版本范围之间感到困惑。 When you declare android:minSdkVersion="9" on the AndroidManifest.xml you are stating that your app should be able to run on API 9+. 当您在AndroidManifest.xml上声明android:minSdkVersion="9"时,即表示您的应用程序应能够在API 9+上运行。

The Android resource structure was stablished to allow developers to use different resources depending on the resolution, screen size, and Android version (among other things) a given device is running. 建立了Android资源结构,以允许开发人员根据分辨率,屏幕大小和运行给定设备的Android版本(除其他因素外)使用不同的资源。 You still need to respect what your minSdkVersion is set to; 您仍然需要尊重您的minSdkVersion设置; in your case it is 9. Theme.Holo.Light.DarkActionBar was introduced on API 11, so you cannot use that style since it was not present in API 9. 在您的情况下为Theme.Holo.Light.DarkActionBar是在API 11上引入的,因此您无法使用该样式,因为它在API 9中不存在。

To give you an example, trying to use Theme.Holo.Light.DarkActionBar when your minSdkVersion is 9 is like trying to get a reference of the ActionBar when your minSdkVersion is 9 (assuming you are not using the support library). 给你举个例子,尝试使用Theme.Holo.Light.DarkActionBar当你minSdkVersion是9就像是试图获得的基准ActionBar ,当你minSdkVersion是9(不使用支持库假设)。 Both of these features were not added until a later API; 这两个功能直到后来的API才添加。 they were not part of Android, they didn't exist. 它们不是Android的一部分,不存在。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到与给定名称“ android:Theme.Holo.Light.DarkActionBar”匹配的资源 - No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar' 检索项目的父项时出错:找不到与给定名称匹配的资源&#39;@android:style / Theme.AppCompat.Light.DarkActionBar&#39; - Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.AppCompat.Light.DarkActionBar' Android studio错误检索项目的父项:找不到与给定名称“Theme.AppCompat.Light.DarkActionBar”匹配的资源 - Android studio Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar' 键入错误:检索项目的父项时出错:未找到与给定名称&#39;android:Theme.Holo.Light&#39;相匹配的资源。 - Type error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'. Xamarin-检索项目的父项时出错:找不到与给定名称&#39;Theme.AppCompat.Light.DarkActionBar&#39;匹配的资源 - Xamarin - Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar' 检索项目的父项时遇到错误:找不到与给定名称“ Theme.AppCompat.Light.DarkActionBar”匹配的资源 - Faced with Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar' 找不到与给定名称'@ style / Theme.Holo.Light.DarkActionBar'匹配的资源 - No resource found that matches the given name '@style/ Theme.Holo.Light.DarkActionBar' 找不到与给定名称&#39;@ style / Theme.Holo.Light.DarkActionBar匹配的资源 - No resource found that matches the given name '@style/ Theme.Holo.Light.DarkActionBar Eclipse错误创建android应用程序:检索项的父项时出错:找不到与给定名称&#39;Theme.AppCompat.Light.DarkActionBar&#39;匹配的资源 - Eclipse error create android app:Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar' 错误:检索项目的父项时出错:找不到与给定名称“android:Theme.Holo”匹配的资源 - error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM