当你的androidAPI 由2.1版本更换成2.2版本时:
 res/vavlues/styles.xml中使用的android:WindowTitle会报以下异常,
error: Error retrieving parent for item: No resource found that matches the given name 'android:WindowTitle'.
从而导致我们的程序无法编译通过。
 
原因:
android2.1中的某些API(包括类方法或者XML属性)更换成android2.2时,它们的路径已经发生了改变,从而导致编译器无法找到它们,所以编译无法通过。
 
 

解决方案:

1. 在Eclipse中打开任意一个.java文件,输入
   android.R.style.
   这时你会看到一个提示列表,仔细看看,里面确实没由WindowTitle, 但是我们发现了一个TextAppearance_WindowTitle. 没错, 在android2.2中,它已经被改成了TextAppearance_WindowTitle。
 
2. 回到报错的res/values/styles.xml, 将<style name="XWindowTitle" parent=""> 
   相应地修改成
  <style name="XWindowTitle" parent="android:TextAppearance.WindowTitle">
 
  注意:这里你也许会注意到 .java文件中的XML属性,与 .xml文件中XML属性很是类似。
  这不是巧合,android官方文档规定:
  java文件中的android.R.style.TextAppearance_WindowTitle 对应
  xml文件中的android:TextAppearance.WindowTitle。 “下划线”与“点”时对应关系。
 
关于Styles and Themes 之间的关系,请参考官方网站

No resource found that matches the given name 'android:WindowTitle'的更多相关文章

  1. 项目引入android-support-v7-appcompat遇到的问题,no resource found that matches the given name 'android:Theme.AppCompat.Light'

    一.问题 今天准备使用v7包中的ToolBar来用,但是在styles.xml中引入Theme.AppCompat.Light的时候,报错“no resource found that matches ...

  2. error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.

    引用appcompat 类库提示 error: Error retrieving parent for item: No resource found that  matches the given ...

  3. Android - 错误:&quot;No resource found that matches the given name android:Theme.Material&quot;

    Android - 错误:"No resource found that matches the given name android:Theme.Material" 本文地址:  ...

  4. No resource found that matches the given name 'android:Widget.Material.A解决方案

    1:首先新建空白工作区 2:先import appcompat_v7 appcompat_v7在一个类似这样的地方, C:\mywork\android\android-sdk-windows\ext ...

  5. Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.

    改下build.gradle文件,将里面的compileSdkVersion改为23即可 apply plugin: 'com.android.application' android { compi ...

  6. 解决Android中No resource found that matches android:TextAppearance.Material.Widget.Button.Inverse问题

    解决Android中No resource found that matches android:TextAppearance.Material.Widget.Button.Inverse问题http ...

  7. eclipse新建项目,报错“Error: workspace\appcompat_v7\res\values-v21\styles_base.xml No resource found that matches the given name”

    新建项目报错,不知道为什么,以前从未出现过的错误,把sdk更新之后,出现莫名错误,自己也是一知半解,在网上找了好久的错误,终于在一个english网站找到了解决方法,soga,从未觉得english如 ...

  8. 【转】eclipse新建项目,报错“Error: workspace\appcompat_v7\res\values-v21\styles_base.xml No resource found that matches the given name”

    原文网址:http://www.cnblogs.com/mbp-study/p/5268478.html 新建项目报错,不知道为什么,以前从未出现过的错误,把sdk更新之后,出现莫名错误,自己也是一知 ...

  9. android中出现Error retrieving parent for item: No resource found that matches the Theme.AppCompat.Light

    styles.xml中<style name="AppBaseTheme" parent="Theme.AppCompat.Light">提示如下错 ...

随机推荐

  1. (Problem 29)Distinct powers

    Consider all integer combinations ofabfor 2a5 and 2b5: 22=4, 23=8, 24=16, 25=32 32=9, 33=27, 34=81, ...

  2. vs2010根据字符串内容添加断点

    在vs中我们可以直接用表达式.数值型比较直接用操作符即可. 如i==2,i<2; 但是字符型比较呢? 加入我们有一个名为string的变量,定义如下: char *string="Tw ...

  3. Windows Azure 社区新闻综述(#76 版)

    欢迎查看最新版本的每周综述,其中包含有关云计算和 Windows Azure 的社区推动新闻.内容和对话.以下是本周的亮点. 文章.视频和博客文章 ·   更新 Windows Azure 中的 SQ ...

  4. Selenium2使用vncserver启动firefox

    web自动化测试使用Selenium2使用vncserver启动firefox 1st startup vncserver(e.g. vncserver :1). 2nd set DISPLAY(e. ...

  5. ios8 swift开发:显示变量的类名称

    var ivar = [:] ivar.className // __NSDictionaryI var i = 1 i.className // error: 'Int' does not have ...

  6. Apache JMeter - load test tool

    What is it? ->>>> http://jmeter.apache.org/index.html  (Please read!) Where to get it? - ...

  7. C#_会员管理系统:开发四(日志查看)

    新建一个日志查看窗体: 日志需要的登录时间和登录状态信息由用户刚登录程序时就提供,所以在登录窗体(VIPLogin.cs)中添加代码: //定义一个全局变量 Uid; //用于获取登录成功后的用户名 ...

  8. vs2010如何打开vs2013

    vs2010如何打开vs2013 百度经验有,简单实用.

  9. __autoload函数

    ./index.php----------------------------------------------------------------------------------<?ph ...

  10. 使用阿里云集成包快速搭建LAMP+FTP教程

    LAMP集成包安装步骤 1.下载开发集成包 下载最新版的阿里云市场提供的WEB开发集成包(内含Apache.Mysql.PHP.vsftpd) #Linux指令wget http://gongdan. ...