Android Basic Tags

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.