2011年7月11日 星期一

[Resource] Android resource syntax

@
- 引用已定義好的資源或是android所提供的資源
- ex: @string, @android:string, @+id (表示新增新的id)...etc

?
- 引用style中的資源,引用属性 (?)
- 表示引用的資源是在當前主題定義過的 (?)
A style attribute resource allows you to reference the value of an attribute in the currently-applied theme. Referencing a style attribute allows you to customize the look of UI elements by styling them to match standard variations supplied by the current theme, instead of supplying a hard-coded value. Referencing a style attribute essentially says, "use the style that is defined by this attribute, in the current theme."

* Notice the use of the at-symbol (@) and the question-mark (?) to reference resources. The at-symbol indicates that we're referencing a resource previously defined elsewhere (which may be from this project or from the Android framework). The question-mark indicates that we're referencing a resource value in the currently loaded theme. This is done by referring to a specific by its name value.


* Reference
- 1 2 3
- Android Styles & Themes(下)——Theme | mo-Android
- Android - Applying Styles and Themes

沒有留言:

張貼留言