跳到主要內容
- @
Note here the use of the '@' prefix to introduce a resource reference --
the text following that is the name of a resource in the form of @[package:]type/name.
In this case we didn't need to specify the package because we are referencing a resource in our own package. To reference a system resource, you would need to write:
- ?
Note that this is very similar to a resource reference, except we are using an '?' prefix instead of '@'. When you use this markup, you are supplying the name of an attribute resource that will be looked up in the theme
-- because the resource tool knows that an attribute resource is expected,
you do not need to explicitly state the type (which would be ?android:attr/android:textDisabledColor).
- @ ?
Other than using this resource identifier to find the value in the theme instead of raw resources, the name syntax is identical to the '@' format: ?[namespace:]type/name with the type here being optional.
- android defines (*.xml)
frameworks\base\core\res\res\values
attrs.xml , attrs_manifest.xml , public.xml , styles.xml , themes.xml
- You can get more information from SDK documments.
Framework Topics | User Interface | Declaring Layout ....
- Reference
- android resources
- Resources and Internationalization
- android read xml
- understanding-android-themes-and-styles
留言
張貼留言