Example:
<TextViewAndroid:id= "@+id/tvnewdevice"Android:layout_width= "0DP"Android:layout_height= "38DP"Android:layout_weight= "1"Android:layout_margintop= "0DP"Android:text= "Add Device"android:textalignment= "Center"android:gravity= "Center"Android:textcolor= "@color/color_text_gray"android:textsize= "@dimen/title_text_size"Android:background= "@drawable/tv_bg_selector"android:clickable= "true" />
Android:textalignment= "Center"--Horizontal Center
android:gravity= "Center"--Vertical Center
android:background= "@drawable/tv_bg_selector"--Check status
Android:clickable= "true"
<?XML version= "1.0" encoding= "Utf-8"?><selectorxmlns:android= "Http://schemas.android.com/apk/res/android" > <Itemandroid:state_pressed= "true"> <ShapeAndroid:shape= "Rectangle"> <SolidAndroid:color= "#11000000"/> </Shape> </Item> <Itemandroid:state_pressed= "false"> <ShapeAndroid:shape= "Rectangle"> <!--Transparent Color - <SolidAndroid:color= "#00000000"/> </Shape> </Item></selector>
[Android] TextView Property Description