Common Properties for Android development

Source: Internet
Author: User

1. Add space between Android String.xml text

Android String.xml tips for adding spaces before and after

<string name= "Password" > Secret & #160;& #160;& #160;& #160; code </string>


& #160 This represents a space.

2. Text line display

TextView, EditView single-line display and input in Android layout file

<textview android:singleline= "true"/>: Text line display

<editview android:singleline= "true"/>: text input box single line input

Android:singleline= "true" single-line display

3. EditView Input Box Properties

EditView password input and digital input control in Android layout file

<editview android:password= "true"/>: input data for text input box is not displayed directly

<editview android:numeric= "integer"/>: input data of text input box can only be numeric

android:numeric= "integer" Digital input control, android:password= "true": password content hiding

4, EditView input content prompt

EditView input hint in android layout file

<editview android:hint= "@string/input_pwd"/>: Display prompt content in text input box

android:hint= "@string/input_pwd" when the input box gets focus, the default display disappears

5. EditView Input Length Control

EditView input Length control in Android layout file

<editview android:minlength= "5"/>: Sets the minimum input amount for the text input box

<editview android:maxlength= "Ten"/>: Sets the maximum input for the text input box

MinLength, MaxLength: input Length control

6. Control Display Control

Control display control in Android layout file

Android:visibility= "Gone": Control is gone

Android:visibility= "Invisible": control is not visible, but exists

android:visibility= "visible": control is displayed normally, system default value

7. Typesetting control in Layout files

Relativelayout, LinearLayout, ListView internal control typesetting control in Android layout file

android:orientation= "Vertical": Vertical layout

android:orientation= "Horizontal": Horizontal layout

8, the application of horizontal screen, vertical screen display

Android Androidmanifest.xml file Settings app display orientation

Android:screenorientation= "Portrait": Vertical screen Display

9, go to the title control

Android Androidmanifest.xml File Settings activity Untitled

Android:theme= "@android: Style/theme.notitlebar": Title not displayed

Today for everyone to summarize these, are very common attributes, I hope that the development of everyone has a certain help.

Common Properties for Android development

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.