TextView label
<TextView android:text= "I am hahaha haha ha ha haha study androd" android:textsize= "25DP" Android:textcolor= "@android: Color/holo_blue_dark" android:layout_width= "Wrap_content" android:layout_height= "Wrap_content" android:singleline= "true" />
Text: displaying textual information
TextSize: Setting Text Size
TextColor: Setting text color
Singleline: Single-line display
Ellipsize: Sets the position of the ellipsis display, which by default is end(end) start(beginning) Middle (middle)
<textview android:text = "haha haha ha ha ha ha ha ha ha haha hahaha haha haha ha ha haha" android:textsize = "25DP" Android:textcolor= "@android: Color/holo_blue_dark" android:layout_width = "Wrap_content" android:layout_height = "Wrap_content" an Droid:singleline = "true" android:ellipsize = "marquee" android:focusable =" true " Android:focusableintouchmo De = "true" Android:marqueerepeatlimit = "1"/>
Android:singleline= "true"
Android:ellipsize= "Marquee"
Android:focusable= "true"
Android:focusableintouchmode= "true"
Android:marqueerepeatlimit cyclic scrolling (attribute value marquee_forever means scrolling)
android:marqueerepeatlimit= "5"
Enabled: Sets whether the button can be clicked
Drawabletop: Add a picture above the button text
Drawablebottom
Drawableleft
Drawableright
Drawablestart: Internationalization standard left
Drawableend: Internationalization standard Right
<TextView Android:text= "QQ Email: [Email protected] Tel: 15116964938 website: www.baidu.com"android:textsize= "25DP"Android:textcolor= "@android: Color/holo_blue_dark"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:autolink= "All"/> <Button Android:text= "This is just a button"Android:textcolor= "@android: Color/holo_green_light"android:textsize= "30DP"android:enabled= "false"Android:drawabletop= "@mipmap/ic_launcher"Android:drawableright= "@mipmap/ic_launcher"Android:drawableleft= "@mipmap/ic_launcher"Android:drawablebottom= "@mipmap/ic_launcher"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"/> <Button Android:text= "ER"Android:id= "@+id/but01"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"/> <Button Android:text= "San"Android:id= "@+id/but02"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"/> <TextView Android:id= "@+id/tvshow"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"/>
Code
@Overrideprotected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (R.layout.layout_textview); View.onclicklistener Click=NewView.onclicklistener () {@Override Public voidOnClick (View v) {intID =V.getid (); Switch(ID) { CaseR.id.but01:tvshow=(TextView) Findviewbyid (r.id.tvshow); Tvshow.settext ("I'm coming."); Break; CaseR.id.but02:tvshow=(TextView) Findviewbyid (r.id.tvshow); Tvshow.settext ("I'm coming, number second."); Break; } } }; Button Button=(Button) Findviewbyid (r.id.but02); Button Button2=(Button) Findviewbyid (r.id.but01); Button.setonclicklistener (click); Button2.setonclicklistener (click); //Attention:this is auto-generated to implement the APP indexing API. // SeeHttps://g.co/AppIndexing/AndroidStudioFor more information.Client =NewGoogleapiclient.builder ( This). Addapi (APPINDEX.API). build (); }
Android Basic Tags