<item android:id="@+id/camera"
android:title="Camera"
android:icon="?attr/menuIconCamera"
android:showAsAction="ifRoom" />

其中图标不是通常用的@drawable/ic_menu_camera_holo_light,而用?attr/menuIconCamera代替,而找到menuIconCamera,却没有图标对应

<resources>
<declare-styleable name="AppTheme">
<attr name="menuIconCamera" format="reference" />
<attr name="menuIconToggle" format="reference" />
</declare-styleable>

SDK中对此一段描述:

For example, here's how you can reference an attribute to set the text color to match the "primary" text color of the system theme:

<EditText id="text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="?android:textColorSecondary"
android:text="@string/hello_world" />

Here, the android:textColor attribute specifies the name of a style attribute in the current theme. Android now uses the value applied to the android:textColorSecondary style attribute as the value for android:textColor in this widget. Because the system resource tool knows that an attribute resource is expected in this context, you do not need to explicitly state the type (which would be ?android:attr/textColorSecondary)—you can exclude the attr type.(在这里,android:textColor属性指定一个样式的名称属性在当前主题。Android现在使用的值应用于Android:textColorSecondary样式属性的值为Android:textColor在这个小部件。因为系统资源工具知道一个属性资源预计将在这种情况下,您不需要显式地声明类型(这将是? android:attr / textColorSecondary)-你可以排除attr类型。)

其实要找到menuIconCamera对应图标可以在styles.xml中找到

<item name="menuIconCamera">@drawable/ic_menu_camera_holo_light</item>

android布局文件中android:icon="?attr/menuIconCamera"找不到对应图标路径的更多相关文章

  1. android 布局文件中xmlns:android="http://schemas.android.com/apk/res/android"

    http://blog.163.com/benben_long/blog/static/199458243201411394624170/ xmlns:android="http://sch ...

  2. android xml 布局文件中 android:ems="10"

    宽度为10个字符的宽度 xml中 android:ems属性 ,作为EditText 默认生成 的属性,其含义是需要编辑的 字符串长度 .设置为10时,最多编辑 10个em ,一个em单位是 两个in ...

  3. Android查缺补漏(View篇)--布局文件中的“@+id”和“@id”有什么区别?

    Android布局文件中的"@+id"和"@id"有什么区别? +id表示为控件指定一个id(新增一个id),如: <cn.codingblock.vie ...

  4. Android 自定义View及其在布局文件中的使用示例

    前言: 尽管Android已经为我们提供了一套丰富的控件,如:Button,ImageView,TextView,EditText等众多控件,但是,有时候在项目开发过程中,还是需要开发者自定义一些需要 ...

  5. Android 自定义View及其在布局文件中的使用示例(三):结合Android 4.4.2_r1源码分析onMeasure过程

    转载请注明出处 http://www.cnblogs.com/crashmaker/p/3549365.html From crash_coder linguowu linguowu0622@gami ...

  6. Android 自定义View及其在布局文件中的使用示例(二)

    转载请注明出处 http://www.cnblogs.com/crashmaker/p/3530213.html From crash_coder linguowu linguowu0622@gami ...

  7. Android中布局文件中使用onClick属性

    安卓开发中,布局文件中的控件有一个属性,是onClick,例如:           <Button             android:id="@+id/button1" ...

  8. android布局layout中的一些属性

      1.可以使某些资源文件或UI组件可重用 <include layout="@layout/other"/>  2.定义一个文本编辑框,使用绝对定位 android: ...

  9. Xamarin Android布局文件没有智能提示

    Xamarin Android布局文件没有智能提示 在Visual Studio 2015中,Android项目的Main.axml文件没有智能提示,不便于布局文件的编写.解决办法:(1)从Xamar ...

随机推荐

  1. JavaScript 笔记

    function (函数)document(文档 get获得文档中..) <script type="text/javascript"> function yz(){ ...

  2. 归并求逆序数(逆序对数) && 线段树求逆序数

    Brainman Time Limit: 1000 MS Memory Limit: 30000 KB 64-bit integer IO format: %I64d , %I64u   Java c ...

  3. 使用 {$INCLUDE} 或 {$I} 指令管理和调用自定义函数

    这是一个简单.方便而又实用的小技巧. 譬如这段代码中有四个定义函数: MyAdd.MyDec.MyMul.MyDiv unit Unit1; interface uses   Windows, Mes ...

  4. XCAT在虚拟机上部署系统

    xcat更新到2.13了,老的manual很多都没用了.前一整子居然没搞成功,只好再来试一次. 官网也搬到了xcat.org.首先就是下core和dep包 分别是 xCAT Core Packages ...

  5. Linux下添加新硬盘,分区及挂载(转)

    挂载好新硬盘后输入fdisk -l命令看当前磁盘信息,卸载硬盘分区 umount /dev/sdb 可以看到除了当前的第一块硬盘外还有一块sdb的第二块硬盘,然后用fdisk /dev/sdb 进行分 ...

  6. 高性能网站架构设计之缓存篇(5)- Redis 集群(上)

    集群技术是构建高性能网站架构的重要手段,试想在网站承受高并发访问压力的同时,还需要从海量数据中查询出满足条件的数据,并快速响应,我们必然想到的是将数据进行切片,把数据根据某种规则放入多个不同的服务器节 ...

  7. chrome的自动缓存真是讨厌。

    最近老是遇到这样一个问题,为什么我的代码改了,页面却一点变化都没有,难道代码错了,打开chrome的调试窗口一看,md,页面根本就没有刷新,逗你爹玩儿呢. 不过幸好,这该死的缓存是可以关闭的. F12 ...

  8. [异常解决] vmware tools 虚拟机 --> 更新/导入wmwera tools菜单变灰,无法导入问题解决

    在虚拟中的装Ubuntu只要下载一个Ubuntu镜像,按照新建的指示一步一步安装 ,但是安装好之后想从原来系统中复制点东西到虚拟机中的Ubuntu中却有点麻烦.幸好Vmware自带了一个VMware ...

  9. Weibo用户地图

    1.1.1 摘要 现在,许多应用都提供地理位置定位的功能,只要用户开放他们的位置信息就可以实现定位了,今天我们将创建一个基于Google 地图的微博用户地图,这里我们将通过Weibo API获取微博用 ...

  10. [HIMCM暑期班]第2课:建模

    第二节课从最简单的模型开始入手:七桥问题. 首先,先去wikipedia上了解一些有关七桥问题的背景知识.http://en.wikipedia.org/wiki/Seven_Bridges_of_K ...