天天看點

android布局檔案中android:icon="?attr/menuIconCamera"找不到對應圖示路徑

其中圖示不是通常用的@drawable/ic_menu_camera_holo_light,而用?attr/menuIconCamera代替,而找到menuIconCamera,卻沒有圖示對應

SDK中對此一段描述:

Here, the <code>android:textColor</code> attribute specifies the name of a style attribute in the current theme. Android now uses the value applied to the <code>android:textColorSecondary</code> style attribute as the value for <code>android:textColor</code> 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 <code>?android:attr/textColorSecondary</code>)—you can exclude the <code>attr</code> type.(在這裡,android:textColor屬性指定一個樣式的名稱屬性在目前主題。Android現在使用的值應用于Android:textColorSecondary樣式屬性的值為Android:textColor在這個小部件。因為系統資源工具知道一個屬性資源預計将在這種情況下,您不需要顯式地聲明類型(這将是? android:attr / textColorSecondary)-你可以排除attr類型。)

其實要找到menuIconCamera對應圖示可以在styles.xml中找到

&lt;item name="menuIconCamera"&gt;@drawable/ic_menu_camera_holo_light&lt;/item&gt;