How To Load Image In Textview?
I want to display image in textview,is it possible?anybody knows,please give sample code for me.. Thanks All
Solution 1:
you can use
SpannableString ss = new SpannableString("abc");
Drawable d = img.getDrawable();
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
ImageSpan span = new ImageSpan(d, ImageSpan.ALIGN_BASELINE);
ss.setSpan(span, 0, 3, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
et.setText(ss);
Solution 2:
tv.setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom);
Post a Comment for "How To Load Image In Textview?"