Can someone explain the attr?

前端 未结 6 1111
夕颜
夕颜 2021-01-30 00:16

I am looking at the Honeycomb Gallery sample code (here) and I ran across the following code while trying to add action items in my own app:



        
6条回答
  •  囚心锁ツ
    2021-01-30 00:24

    The ?attr/menuIconCamera value means that an icon from menuIconCamera attribute of the current theme will be used.

    There must be a drawable assigned to the menuIconCamera attribute somewhere in the themes.xml file. If there're two themes with different values of this attribute then actual icon will depend on a theme which is currently used.

    The attrs.xml file is used to define custom attributes. Without this definition compiler will treat unknown attributes as erroneous.

提交回复
热议问题