Common properties for Android development

Common properties for Android development

1. Add spaces between text in android string.xml

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 text display

TextView, EditView single line display and input in android layout file

<TextView android:singleLine="true"/>: Text is displayed in a single line

<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 number input control in android layout file

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

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

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

4. EditView input content prompt

EditView input content prompt in android layout file

<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 default displayed content disappears

5. EditView input length control

EditView input length control in android layout file

<EditView android:minLength="5"/>: Sets the minimum input length of the text input box

<EditView android:maxLength="10"/>: Sets the maximum input length of the text input box

minLength, maxLength: input length control

6. Control display control

Control display control in android layout file

android:visibility="gone": The control is gone

android:visibility="invisible": The control is invisible but exists

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

7. Typesetting control in layout files

Layout control of RelativeLayout, LinearLayout, and ListView internal controls in android layout files

android:orientation="vertical": vertical layout

android:orientation="horizontal": horizontal layout

8. Application horizontal and vertical screen display

android AndroidManifest.xml file sets the application display direction

android:screenOrientation="portrait": vertical screen display

9. Remove title control

android AndroidManifest.xml file sets Activity without title

android:theme="@android:style/Theme.NoTitleBar": Do not display the title

<<:  Android Control WebView

>>:  Lollipops are slowing down, KitKat is still going strong, and Gingerbread is not going away

Recommend

Why hasn't Google produced a product that revolutionized the world since search?

Google has been a paradise for engineers since it...

Three key cores of new media marketing promotion plan!

All things are difficult at the beginning. What i...

I already have lung cancer. Is it meaningless to quit smoking? The truth is...

Recently, the topic #刘谦患pulmonary adenocarcinoma#...

Will Android devices and iPhones support Windows 10's "killer app"?

Last year, Microsoft launched the Windows Hello fe...

McLaren releases 675LT MSO official pictures, limited to 25 units worldwide

According to foreign media reports on December 9,...

Analysis of the hot marketing calendar in December!

December Holidays December 1 World AIDS Day Decem...

A Beginner's Guide to Brand Building

The purpose of brand naming is to empower "s...

Android collects nearly 10 times more user data than iOS, report says

Following the Android location tracking scandal, ...

Typhoon Tali is about to land! How should we defend and respond?

At present, this year's No. 4 typhoon "T...