2012-03-09 3 views
1

android in xmlのレイアウト。android:background = "?buttonSelectableBackground"、what "?"手段?

"android:background ="?buttonSelectableBackground ""はどういう意味ですか?

は私がkonw:描画可能/ buttonSelectableBackground @「アンドロイド背景=」「」手段を、私は

<LinearLayout 
    android:id="@id/titlebar_icon_layout" 
    android:layout_width="wrap_content" 
    android:layout_height="fill_parent" 
    android:layout_alignParentLeft="true" 
    android:background="?buttonSelectableBackground" 
    android:gravity="center_vertical" 
    android:orientation="horizontal" > 

    <ImageView 
     android:id="@id/titlebar_up" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/ic_ab_back_holo_dark" /> 

    <ImageView 
     android:id="@id/titlebar_icon" 
     android:layout_width="@dimen/titlebar_icon_size" 
     android:layout_height="@dimen/titlebar_icon_size" /> 
</LinearLayout> 

答えて

3

これは、スタイル属性への参照であることを知らない、名前の構文はほぼ同じです通常のリソース形式ではなく、アットマーク(@)の代わりに疑問符(?)を使用し、リソースタイプの部分はオプションです。たとえば:

?[<package_name>:][<resource_type>/]<resource_name> 

詳細はhttp://developer.android.com/guide/topics/resources/accessing-resources.htmlを参照してください。

+0

私はそれを知らなかった:https://developer.android.com/guide/topics/resources/accessing-resources.html#ReferencesToThemeAttributes – TryTryAgain

+1

特に、それはテーマ属性だ。それをポインタの逆参照と考えてください。 – adamp