android资源引用中各种符号的意义

来源:互联网 发布:mac电脑绘图软件 编辑:程序博客网 时间:2024/04/29 10:15

        之前在工作学习的过程中养成一个毛病,一遇到问题,网上各种求解。问题解决了,但是遗留了不少东西并没有非常清楚其中原委,例如,android中资源的引用,其中有@+type和@type以及@android:等等,今天网上一查,已经有人写博客总结了这些符号的意义。于是将其引用至此,源博客链接为:http://www.cnblogs.com/greatverve/archive/2011/12/27/Android-xml.html


       1.@type代表引用资源,格式为:@[package:]type/name

           例如:  

                  a.   @string/ 

                  b.   @id/

                  c.    @drawable/

         2.@android代表引用的系统资源,其格式为:@android:type/name

           例如:

                  a.   @android:style/

                  b.   @android:anim/

        3.?android表示引用主题属性,其格式为:?android:type/name

           例如:

                  a.   ?android:attr/progressBarStyleHorizontal

                  其中attr可以省略不写?android:progressBarStyleHorizontal

4.@+type表示创建资源,格式为:@+type/name

           例如:

                   a.   @+id/

 

           

1 0
原创粉丝点击