<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. CentOS7使用阿里云镜像安装Mongodb

    一.概述 近日要在新的CentOS系统上安装MongoDB,某度结果后直接从Mongo官网直接获得3.2版本的下载链接,结果在下载时发觉速度慢的可怜.迫于无奈,只能找国内的镜像下载.切换国内的安装源后 ...

  2. 字符串反混淆实战 Dotfuscator 4.9 字符串加密技术应对策略

    因为手头需要使用一个第三方类库,网络上又找不到它的可用的版本,于是只好自己动手.这个类库使用了Dotfuscator 加密,用.NET Reflector加载程序集, 看到的字符串是乱码,如下面的代码 ...

  3. pdf.js在IIS中配置使用笔记

    最近在手机App开发Android版本时候遇到需要显示PDF文件的需求,记得之前直接使用系统浏览器或者WebView就可以显示,但是现在不可以了,只能另寻其他办法. 最终找到PDF.JS来进行实现,但 ...

  4. objective-c(接口&实现)

    objective-c在xcode6下的例子: 定义接口 #import <Foundation/Foundation.h> //基础库,类似C中的stdlib typedef ,type ...

  5. Entity Framework 5.0系列之Code First数据库迁移

    我们知道无论是"Database First"还是"Model First"当模型发生改变了都可以通过Visual Studio设计视图进行更新,那么对于Cod ...

  6. JavaScript—之对象参数的引用传递

    变量 1.JavaScript hoisting >>请看例子,我们拿Chrome的console作为JS的运行环境. 上面直接执行console.log(a), 不带一点悬念地抛出了no ...

  7. LuaAlchemy API 介绍

    The AS3 Sugar provides a Lua-like way to access AS3 class and instance creation, property getter/set ...

  8. Oracle数据库面试题【转载】

    1. Oracle跟SQL Server 2005的区别? 宏观上: 1). 最大的区别在于平台,oracle可以运行在不同的平台上,sql server只能运行在windows平台上,由于windo ...

  9. lua实现深度拷贝table表

    lua当变量作为函数的参数进行传递时,类似的也是boolean,string,number类型的变量进行值传递.而table,function,userdata类型的变量进行引用传递.故而当table ...

  10. Atitit usrQBM2331 参数格式化规范

    Atitit usrQBM2331 参数格式化规范 String sql = "insert agent(uid,parent_id,pwd,name,tel,wechat,bkkad,si ...