安卓开发中Theme.AppCompat.Light的解决方法

来源:互联网 发布:java素数判断 编辑:程序博客网 时间:2024/06/05 11:16

styles.xml中<style name="AppBaseTheme" parent="Theme.AppCompat.Light">提示如下错误,这是版本问题。

error: Error retrieving parent for item: No resource found that matches the given name 

 'Theme.AppCompat.Light'.


 解决方法:

在Eclipse中打开任意一个.java文件,输入  android.R.style.   这时你会看到一个提示列表,仔细看看,再对比一下,看哪个与原有的最接近就选择哪个。用将下划线替换成"."就可了。

<style name="AppBaseTheme" parent="Theme.AppCompat.Light">

改为

<style name="AppBaseTheme" parent="android:Theme.Light">
 同理,将
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
改为
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">

装载原博客 :http://blog.163.com/wslngcjsdxdr@126/blog/static/16219623020146971323118/

亲测可以用。
0 0
原创粉丝点击