Skip to content Skip to sidebar Skip to footer

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:


Post a Comment for "How To Load Image In Textview?"