【问题标题】:android:background="?buttonSelectableBackground" , what "?" means?android:background="?buttonSelectableBackground" ,什么“?”方法?
【发布时间】:2012-03-26 16:48:08
【问题描述】:

android 在 xml 中的布局。

“android:background="?buttonSelectableBackground"” 是什么意思?

我知道 "android:background="@drawable/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>

【问题讨论】:

    标签: android xml layout user-interface


    【解决方案1】:

    这是对样式属性的引用,名称语法几乎与普通资源格式相同,但不是使用 at 符号 (@),而是使用问号 (?),并且资源类型部分是可选的。例如:

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

    详情请见http://developer.android.com/guide/topics/resources/accessing-resources.html

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-10
    • 1970-01-01
    • 2021-10-28
    相关资源
    最近更新 更多