最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

what is main "?" "@" ":" symbol in android xml - Stack Overflow

programmeradmin2浏览0评论

I can't find any documentation or something like that about "?" "@" ":" symbol in android xml. It often using in themes and styles in android development. What is symbols exactly means can't understand.

Please give some docs?

I can't find any documentation or something like that about "?" "@" ":" symbol in android xml. It often using in themes and styles in android development. What is symbols exactly means can't understand.

Please give some docs?

Share Improve this question edited Mar 10 at 15:05 TylerH 21.1k79 gold badges79 silver badges114 bronze badges asked Mar 10 at 7:34 AbbosAbbos 1 1
  • 1 Documentation – tomerpacific Commented Mar 10 at 7:49
Add a comment  | 

2 Answers 2

Reset to default 1

These are pretty simple actually.

1. The "@" is the symbol which is used for resources or while declaring id, like @string/hello , @+id/button, or @drawable/my_drawable .

2. The "?" is refers to a theme attribute or styleable content, like if you want to define any theme attribute in styles like color etc, you would use this. eg ?attr/colorPrimary .

3.And the last ":" is commonly used in namespaces in XML, it is used to seperate the prefix in the namespace. for eg. android:layout_width="match_parent" . Hence you would know that android is the prefix in the namespace declared.

Those links may help you,plz check.

https://developer.android/guide/topics/resources/providing-resources#ResourcesFromXml

https://developer.android/studio/write/vector-asset-studio#referring

发布评论

评论列表(0)

  1. 暂无评论