Android Self-study notes

Source: Internet
Author: User

Learned about Android's most popular controls today

    1. TextView

<textview android:id= "@+id/text_view" android:layout_width= "Match_parent" android:layout_height= "W Rap_content "android:gravity=" center "android:textsize=" 24SP "android:textcolor=" #00ff00 "Android Oid:text= "This is TextView"/>

2.Button

<button android:id= "@+id/button" android:layout_width= "match_parent" android:layout_height= "Wrap_ Content "android:text=" button "/>

3.EditText

<edittext android:id= "@+id/edit_text" android:layout_width= "Match_parent" android:layout_height= " Wrap_content "android:hint=" Type something Here "android:maxlines=" 2 "/>

4.ImageView

<imageview android:id= "@+id/image_view" android:layout_width= "Match_parent" android:layout_height = "Wrap_content" android:src= "@drawable/ic_launcher"/>

5.ProgressBar

<progressbar android:id= "@+id/progress_bar" android:layout_width= "Match_parent" android:layout_he ight= "wrap_content" style = "android:attr/progressbarstylehorizontal" android:max= "/>"

6.AlertDialog

Alertdialog.builder dialog = new Alertdialog.builder (this);d Ialog.settitle ("This is dialog");d ialog.setmessage (" Something important. "); Dialog.setcancelable (False);d Ialog.setpositivebutton ("OK", new Dialoginterface.onclicklistener () {@Overridepublic void OnClick (Dialoginterface dialog, int which) {//TODO auto-generated method stub}});d Ialog.setnegativebutton ("Cancel", new Dialoginterface.onclicklistener () {@Overridepublic void OnClick (dialoginterface arg0, int arg1) {//TODO auto-generated method stub}}); Dialog.show ();

7.ProgressDialog

ProgressDialog ProgressDialog = new ProgressDialog (this);p Rogressdialog.settitle ("This is ProgressDialog"); Progressdialog.setmessage ("Loading ...");p rogressdialog.setcancelable (True);p rogressdialog.show ();

Common properties can be checked.

Android Self-study notes

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.