Android edittext Control sets the minimum height and the operating height varies with the content increase

Source: Internet
Author: User

(turn) http://www.aichengxu.com/view/1405748 record learning

Title, sometimes edittext need a minimum height, but when you enter more content, you increase the height as the content increases. At this point we can take advantage of EditText's Minlines property.

That is, the minimum number of rows, as long as we specify the Minlines property, and the Layout_height is set to wrap_content, we can achieve our purpose.

<edittext
Android:id= "@id/shareadd_content" android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
Android:gravity= "Left|top" android:hint= "@string/input_share_content" android:textcolor= "@color/gay_33" Android: minlines= "3" android:background= "@drawable/bg_newsdetail_edit"/>

Android edittext Control sets the minimum height and the operating height varies with the content increase

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.