Common attributes of Android Development

Source: Internet
Author: User

Common attributes of Android Development

1. Add spaces in the middle of android string. xml text

Tips for adding spaces before and after android string. xml

<String name = "password"> password & #160; & #160; & #160; & #160; Code </string>

& #160 this represents a space

2. Single line display

Single-row display and input of TextView and EditView in the layout file of android layout

<TextView android: singleLine = "true"/>: displays a single text line.

<EditView android: singleLine = "true"/>: enter a single line in the text input box.

Android: singleLine = "true" Single Row display

3. attributes of the EditView input box

EditView Password Input and digital input control in the android layout File

<EditView android: password = "true"/>: the input data in the text input box is not directly displayed.

<EditView android: numeric = "integer"/>: the input data in the text input box can only be numbers.

Android: numeric = "integer" digital input control, android: password = "true": password content hidden

4. Prompt for EditView input content

Prompt for EditView input in the layout file of android layout

<EditView android: hint = "@ string/input_pwd"/>: displays the prompt content in the text input box.

Android: hint = "@ string/input_pwd" when the input box gets the focus, the content displayed by default disappears.

5. EditView input length control

EditView input length control in the android layout File

<EditView android: minLength = "5"/>: sets the minimum input value of the text input box.

<EditView android: maxLength = "10"/>: sets the maximum input value of the text input box.

MinLength and maxLength: input length control

6. Control the display of controls

Display Control in the layout file of android layout

Android: visibility = "gone": the control disappears.

Android: visibility = "invisible": the control is invisible but exists.

Android: visibility = "visible": controls are displayed normally. Default Value:

7. layout control in layout files

Layout control of RelativeLayout, LinearLayout, and ListView

Android: orientation = "vertical": vertical layout

Android: orientation = "horizontal": horizontal layout

8. Horizontal and vertical screen display

Android AndroidManifest. xml file sets the application display direction

Android: screenOrientation = "portrait": portrait display

9. untitled Control

Android AndroidManifest. xml file sets no title for Activity

Android: theme = "@ android: style/Theme. NoTitleBar": the title is not displayed.

Related Article

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.