Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

need explanation for android layout syntax

Tags:

android

layout

here is a line in layout file

 <TextView 
        android:id="@+id/username"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:text="@string/username"
        android:textAppearance="?android:attr/textAppearanceMedium"> 
in about context what is the exact meaning of
android:textAppearance="?android:attr/textAppearanceMedium" 
is that related to "?[package:][type:]name" , if yes then what that refers to ?
like image 898
Shrenik Avatar asked Jul 11 '26 21:07

Shrenik


1 Answers

?android:attr/textAppearanceMedium is referring to the android.R.attr.textAppearanceMedium This is the way to reference to external package resource content.

Here's an article mentioned this.

like image 185
xandy Avatar answered Jul 14 '26 10:07

xandy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!