Improving on Gio's sugestion, which is probably for a dated API/SDK...
TL:DR - just apply android:drawablePadding
to increase distance between image and text.
Explanation:
android:drawablePadding
now applies padding between CompoundDrawable
and original View
, in this case the TextView containing the text;
android:padding
and modifiers now apply to the whole group, including all compounds.
Doing the negative-positive hack doesn't seem to work no more.
So depending on the drawable position (drawableTop/Left/...), the padding will apply in the opposite direction of it, right next to the drawable, in other words between the two elements. For instance, Applying drawablePadding="10dp"
to a left placed drawable would have a similar effect as setting an individual ImageView
to the left of the TextView with paddingRight="10dp"
(at least padding-wise).
ImageView
s and that was my solution. I even got aTumbleweed
badge for this question so I guess it's impossible. – ExocarpsetCompoundDrawables
method gives you that option please let me know your solution. – ExocarpTextView
and then set a negative padding to the drawable. That would make the text shifted and image on it's own place. I don't have access to my computer ATM so I can't test it. – Exocarp