Step by Step _android Development Course [16]_ User Interface EditText (edit view)

Source: Internet
Author: User

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)

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.