Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is difference between "?actionbarsize","?attr:actionbarsize" and "?android:actionBarSize"?

I am confused about "?actionbarsize","?attr:actionbarsize", "?android:actionBarSize"? and ?android:attr/actionBarSize

I see there are actionbarSize in appcompat-v7 but how this all diffrent value are works.

like image 743
Jaydeep purohit Avatar asked May 27 '16 05:05

Jaydeep purohit


1 Answers

?attr

The ?attr: syntax is used for accessing attributes of current theme.

@android

you want to access a style attribute that's defined in a style theme

EX :

<Toolbar  
    android:layout_height="?android:attr/actionBarSize" //?android
    android:layout_width="match_parent"
    android:background="?android:attr/colorPrimaryDark"
    android:theme="@android:style/ThemeOverlay.Material.Dark.ActionBar" /> //@android

check accessing-resources guides from developer.android.com

like image 186
Amit Vaghela Avatar answered Oct 14 '22 08:10

Amit Vaghela