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