Android Chapter two controls 1

Source: Internet
Author: User

1.Activity: For storing individual display controls, is the basic component of Android

2.Activity Common method: Public final View Findviewbyid (int id) gets Component Object public void Setcontentview (int layoutresidd) settings based on component ID Display components

3. Set the control's ID value: Format: @+id/id value

4.TextView label (label button):

4.1 Common Properties: 1:android:text//define display text for components

2:textcolor://Set the text color of the file

3:textsize://Set the displayed text size

4:textstyle://Set style for text display, bold, italic

4.2 Setting the text's display style: Normal, Bold (bold), Italic (italic)

4.3 Set the component size or text size:

PX: pixels; Dip: device-dependent pixels;

SP: proportional pixels; PT: point; in: feet;

MM: MM

5. GetText (). toString ()//Get the text content of the control SetText ();//Set the text content of the control

6. Button:

6.14.1 Common Properties: 1:android:text//defining display text for components

2:textcolor://Set the text color of the file

3. enable= "flase or ture"//value is false when not pressed

7.EditText button (text edit width)

7.1 Common Properties: 1:android:text//define display text for components

2:textcolor://Set the text color of the file

3. enable= "flase or ture"//value is false when text box cannot be edited

Android Chapter two controls 1

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.