Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between @android: and ?android: [duplicate]

What's the difference between

android:color="@android:color/black"

and

style="?android:attr/borderlessButtonStyle" 

What's the difference between the @ and ? ?

This is one of those questions which is ungoogleable, or ogooglebar.

like image 601
Chloe Avatar asked May 22 '13 05:05

Chloe


1 Answers

@android:color/black

means you are referring to an color defined in the android namespace. This namespace is the namespace of the framework.

search black in this file: black color in framework

style="?android:attr/borderlessButtonStyle"

"?android:attr/borderlessButtonStyle" simply means "use the value defined by the attribute called borderlessButtonStyle in the namespace android." This attribute and its value are part of the Android framework, the "android" namespace.

borderlessButtonStyle in framework


Edited: from this Referencing Style Attributes

this link tell us:

For example, here's how you can reference an attribute to set the text color to match the "primary" text color of the system theme:

<EditText id="text"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textColor="?android:textColorSecondary"
    android:text="@string/hello_world" />
like image 132
Dhaval Parmar Avatar answered Sep 22 '22 03:09

Dhaval Parmar