Android basic entry control (3)

Source: Internet
Author: User

All of the following controls only show the code of this control. The operation will be added to the original control.

1. TextView (text box ):

TextView is used to display text to users. This is the most basic view.

 
   


Running effect:



Android: background: Set the background color

Android: text sets the display content

Android: textColor: Set the font color

Android: layout_gravity sets the center display of the control

Android: textSize: Set the font size


Ii. EditText (edit box ):

EditText allows users to edit their text content.

 


Running effect:

Common attributes:

Android: numeric. You can enter the text type in the edit box.

Android: singleLine: Set single-line Input. If this parameter is set to true, the text will not wrap automatically.

Android: When the password is true, you can only enter a password.

Android: textScaleX sets the spacing between words.

Android: minLines sets the minimum number of lines of text.

Android: EMS sets the length of the text in the editing box.

3. Button ):

Button indicates the Button control.

 

Running effect:


Common attributes:

Android: onClick: Set the event method name.

Android: clickable: Set whether this button can be clicked. True indicates that click is allowed. False indicates that clicking is not allowed.


4. RadioGroup and RadioButton (single choice ):

We combine RadioGroup and RadioButton to complete the single-item selection function.

         
          
          
        
 

Running effect:

You can only select one of the multiple options.

5. CheckBox (multiple options ):

    
     
     
 

Running effect:

The difference between a multi-choice and a single-choice is that multiple options can be selected for multiple choices, and only one option can be selected for a single choice.







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.