问题
I want to add image inside edittext view . For example i have image that size is 250*250 i want to show text left to image for height of 250 after that have to show text in normal left position.
Some text some text some text
Some image Some text some text some text
Some text some text some text
Some text some text some text Some text some
text some text some text some text Some text
some text Some text some text Some text some
回答1:
You can use the xml property android:drawableLeft
or (as mentioned) setCompoundDrawableWithinBounds
. But your EditText
will look something like this:
回答2:
You can add image in editext programmatically using setCompoundDrawableWithinBounds set drawable at left...
来源:https://stackoverflow.com/questions/24902771/how-to-add-a-image-inside-a-edit-text-android