Focus on technology, enjoy life! --qq:804212028
Browse Links: http://blog.csdn.net/y18334702058/article/details/44624305
- Topic: EditText of the user interface (edit view)
EditText Control instance:
Activity_main.xml Source code:
<?xml version= "1.0" encoding= "Utf-8"?><linearlayout xmlns:android="Http://schemas.android.com/apk/res/android" Android:orientation="vertical"android:layout_width="Fill_parent"android: Layout_height="Fill_parent" > <EditTextandroid:id= "@+id/ev"android:layout_height=" Wrap_content "android:layout_width=" fill_parent " /> </linearlayout>
Instantiate it in Mainactivity.java:
Importandroid.app.Activity;ImportAndroid.os.Bundle;ImportAndroid.widget.EditText;ImportAndroid.widget.TextView; Public class mainactivity extends Activity { PrivateEditText ev;@Override protected void onCreate(Bundle savedinstancestate) {Super. OnCreate (Savedinstancestate); Setcontentview (R.layout.activity_main);//instantiation of EditTextEV = (EditText) Findviewbyid (R.id.ev); }}
Operation Result:
EditText Common Properties:
Property name |
Description |
Android:editable |
If set, specifies that the TextView has an input method, and if there is no special designation, it is the text input state. |
Android:hint |
The prompt message that appears when the text is empty. |
Android:inputtype |
The type of data that can be placed in a text field to help the input method decide how to let the user enter text. |
Android:maxlength |
Sets the input filter to limit the maximum length of text entered to the specified value. |
Android:password |
Whether to display the characters in the text field as dots that represent the password. |
Android:text |
The text to display |
Android:textcolor |
Text color |
Android:textsize |
The size of the text. It is recommended to set this value (such as 15SP) in "sp (scaling pixel)" units. |
Android:textstyle |
Text Style (bold, italic, bold italic, etc.). |
Focus on technology, enjoy life! --qq:804212028
Browse Links: http://blog.csdn.net/y18334702058/article/details/44624305
Step-by-step _android Development Course [16]_ User Interface EditText (edit view)