Thursday 15 April 2010

Image inside EditText - Android -



Image inside EditText - Android -

i'm new in android , trying allow user attach image text , when he/she nail send send image backend.

i'm trying hangout or samsung message application chosen image getting placed within edittext, i've been searching while i'm not what for, 1 aware of library that? or steps need follow this?

please note have else working.

if talking little images emoticons/smileys, think can use:

1) setcompounddrawableswithintrinsicbounds

edittext text = (edittext) findviewbyid(r.id.edttest); text.settext("test"); text.setcompounddrawableswithintrinsicbounds(null, null, getresources().getdrawable(r.drawable.mydrawable), null);

or

2) spannablestring (able add together more 1 drawable dynamically)

spannablestring ss = new spannablestring("abc\n"); 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); editt.settext(ss);

according : how can add together image on edittext

otherwise, adding big images text fields might not idea. chat applications separate texts , images while sending individual edittext , imageview components.

android

No comments:

Post a Comment