Android EditView with small icons or text implementations

Source: Internet
Author: User

On this issue, if just add small icon, has provided very good support, Drawableleft property can set the left side of the small icon, and so on, the right can also

But if you want to add the text, I looked for the next, there is no corresponding property, we can only through the transformation of ideas to achieve, my method is to use a layout to include a TextView and a editview on it.

1 <LinearLayout2             Android:layout_width= "Match_parent"3 Android:layout_height= "Wrap_content"4 Android:layout_marginbottom= "10DP"5 Android:layout_margintop= "10DP"6 Android:background= "@drawable/round_view_rim"//This is a fillet, you can refer to my previous article7 android:orientation= "Horizontal"8 android:padding= "10DP">9 Ten             <TextView One                 Android:layout_width= "Wrap_content" A Android:layout_height= "Match_parent" - Android:layout_marginleft= "30DP" - Android:layout_marginright= "30DP" the android:gravity= "Left|center" - Android:text= "Name" /> -  -             <EditText +                 Android:layout_width= "Match_parent" - Android:layout_height= "Wrap_content" + android:layout_gravity= "Center|right" A Android:background= "@null" /> at         </LinearLayout>

Android EditView with small icons or text implementations

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.