[英]No resource found that matche the given name '@style/Theme.AppCompat.Light'
I'm facing few problems related to the theme. 我面临与主题相关的几个问题。
In my manifest, I have the following code: 在清单中,我有以下代码:
<application
android:theme="@android:style/Theme.AppCompat.Light">
By using the above code, there is error No resource found that matches the given name '@style/Theme.AppCompat.Light'
. 通过使用上面的代码,没有错误No resource found that matches the given name '@style/Theme.AppCompat.Light'
。 Please refer to the image below that I've added the reference. 请参考下图,我已经添加了参考。
If I remove the theme setting, I'll receive runtime error saying that I must implement AppCompat theme. 如果删除主题设置,则会收到运行时错误消息,提示我必须实现AppCompat主题。 May I know which part has gone wrong? 我可以知道哪一部分出了错吗?
As it seems you have referenced appcompat v7 library in your project, my initial guess is that you should use 好像您在项目中引用了appcompat v7库一样,我最初的猜测是您应该使用
<application
android:theme="@style/Theme.AppCompat.Light">
instead of 代替
<application
android:theme="@android:style/Theme.AppCompat.Light">
Also ensure that both Android Support Library project and the Main Project have the same minSdkVerson
and targetSdkVersion
. 还要确保Android支持库项目和主项目都具有相同的minSdkVerson
和targetSdkVersion
。
The key thing here i guess is that in the parent attribute android:
.It prefixes built in themes (styles), while a value without this prefix references your own styles or the styles in any libraries you have linked to, in this case android-support-v7-appcompat
. 我想这里的关键是在android:
的parent属性中android:
它以主题(样式)为前缀,而没有此前缀的值引用您自己的样式或您链接到的任何库中的样式,在这种情况下为android-support-v7-appcompat
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.