文章目录
  1. 1. @
  2. 2. @*
  3. 3. ?
  4. 4. @+

@

  • 引入自定义资源,格式为@[package:]type/name
    最常见的资源引用

    1
    android:text="@string/hello"
  • 引入系统资源,格式为@android:type/name

    1
    android:textColor="@android:color/opaque_red"

@*

引用系统非public资源@*android:type/name

系统资源纷纷public和非public,生命在\platforms\android-8\data\res\values\public.xml

相比@android:type/name@*android:type/name能够使用所有Android系统资源,不过Google官方不推介使用

?

?[namespace:]type/name这种方式用于引用当前主题中的属性值,这个属性值只能在style资源和XML属性中使用

1
android:textColor="?android:textDisabledColor"

@+

@+type/name+表示在type中添加一条记录通常用于定义资源id

1
android:id="@+id/select"

文章目录
  1. 1. @
  2. 2. @*
  3. 3. ?
  4. 4. @+