Android Advanced Tour------>android:drawableleft usage

Source: Internet
Author: User

Sometimes I want to put a picture on the left side of EditText:


It is possible to add the following code to the EDITTEXT definition code in the XML layout file:



There are so many properties in TextView that you can draw drawable objects such as pictures at the end of the text.  Android:drawablebottom: Output A drawable at the bottom of text, which can be pictures, styles, colors, etc.  Android:drawableleft: Output A drawable on the left side of text, which can be pictures, styles, colors, etc.  Android:drawableright: Output A drawable to the right of text, which can be pictures, styles, colors, etc.  Android:drawabletop: Output A drawable directly above the text, which can be pictures, styles, colors, and so on.  Android:drawablestart: Outputs a drawable at the beginning of text, which can be pictures, styles, colors, and so on.  Android:drawableend: Outputs a drawable at the end of text, which can be pictures, styles, colors, and so on. Android:drawablepadding: Sets the spacing between text and drawable, which is used with Drawableleft, Drawableright, Drawabletop, Drawablebottom. So the question is, what's the difference between Drawablestart and drawableleft? We read a piece of text, all from left to right, so for us, start is a concept. But some cultures, like Arabs, are from right to left, and the two are diametrically opposed. Use start, end instead of left, right this is the recommended practice for Android's new RTL Layout support. 


For more information, refer to:

http://blog.csdn.net/gao_chun/article/details/38284507

http://blog.csdn.net/csdn_ask/article/details/8640994

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android Advanced Tour------>android:drawableleft usage

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.