我正在查看Honeycomb Gallery示例代码(这里),在尝试在我的应用中添加操作项时,我遇到了以下代码:
<item android:id="@+id/camera"
android:title="Camera"
android:icon="?attr/menuIconCamera"
android:showAsAction="ifRoom" />
?attr
让我感到困惑。能否有人解释一下这是在做什么?这与可绘制对象有什么关系?我在Google上找不到任何有用的信息。另外,是否有属性列表或图库可以用于图标,而不仅仅是menuIconCamera
?
谢谢。
编辑: 我再看看,发现attrs.xml长这样:
<resources>
<declare-styleable name="AppTheme">
<attr name="listDragShadowBackground" format="reference" />
<attr name="menuIconCamera" format="reference" />
<attr name="menuIconToggle" format="reference" />
<attr name="menuIconShare" format="reference" />
</declare-styleable>
很遗憾,这让我更加困惑了。这是做什么用的?