Android EditText problem multi-line text input

Source: Internet
Author: User

Once accustomed to the network and swing in the text box input, our Android suddenly lacks such controls, just beginning to use it is quite laborious. In order to implement multi-line text input box and display. Overcome these problems, as follows:

1. What to do edittext the display area is entered in the text box;

2. Display;

3. How to set the reel.

4. How to fix the size of the text box.

5. How to make the text box display edges;

In order to achieve such effects as the following. We have done for example the following work:


<edittext    android:id= "@+id/add_content"    android:layout_width= "fill_parent"    android:layout_ height= "Wrap_content"    android:enabled= "true"    android:gravity= "top"    android:inputtype= " Textmultiline "    android:minlines=" 8 "    android:maxlines="    android:scrollbars= "vertical     " android:background= "@android:d rawable/edit_text"    ></EditText>

Above is the XML for this control effect.

Two lines to show the effect of the input area;

    Android:inputtype= "Textmultiline"    android:minlines= "8"

android:background= "@android:d rawable/edit_text"  <!

-To display the control's edges,

Android:maxlines= "10"    
The maximum number of rows used to set the area above is 10, and more than 10 lines are displayed as "vertical reels".

android:gravity= "Top"  <!-is used to set the starting position of the cursor from the top line, otherwise the default is to start from the middle of the line


Copyright notice: This article Bo Master original article. Blog, not reproduced without consent.

Android EditText problem multi-line text input

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.