当你的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. 操作数组的工具类Arrays

    Java提供的Arrays类里包含一些static修饰的方法可以直接操作数组. int binarySearch(type[] a, type key)使用二分法查询key元素值在a数组中出现的索引, ...

  2. 无法更新 EntitySet“GuigeInfo”,因为它有一个 DefiningQuery,而 <ModificationFunctionMapping> 元素中没有支持当前操作的 <InsertFunction> 元素。

    1:实体中必须有主键 2:删除创建的模型重新创建

  3. 设置textarea文本域不能调整大小 resize

    CSS3中新增了resize缩放属性,这个属性可以应用到任意元素.目前只有Webkit内核的浏览器才支持这个css3属性,即Google chrome和Apple safari都支持.而textare ...

  4. USB接口的SmartCard Class协议标准:ICCD and CCID

    ICCD是 Intergrated Circuit(s) card Device 的缩写.CCID是 Integrated Circuit(s) cards interface devices的缩写I ...

  5. Windows Phone 8初学者开发—第11部分:设置SounBoard应用程序

    原文 Windows Phone 8初学者开发—第11部分:设置SounBoard应用程序 原文地址: http://channel9.msdn.com/Series/Windows-Phone-8- ...

  6. 高级爬虫工程师(Spider)-美团网-拉勾网-最专业的互联网招聘平台

    高级爬虫工程师(Spider)-美团网-拉勾网-最专业的互联网招聘平台 高级爬虫工程师(Spider)

  7. hdu1698 Just a Hook 线段树:成段替换,总区间求和

    转载请注明出处:http://blog.csdn.net/u012860063 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1698 Problem ...

  8. asp.net利用剪切板导出excel

    public enum ClipboardFormats : uint { CF_TEXT = 1, CF_BITMAP = 2, CF_METAFILEPICT = 3, CF_SYLK = 4, ...

  9. Send Mail 网址

    http://www.codeproject.com/Tips/371417/Send-Mail-Contact-Form-using-ASP-NET-and-Csharp http://www.c- ...

  10. php上传文件,创建递归目录

    <?php $uid=$_REQUEST['uid']; $avatar = 'D:/avic/discuz/uc_server/data/avatar/'.get_avatar($uid, $ ...