tags:

views:

46

answers:

1

Hello,

I am implementing emoticons using the following code:

            builder.setSpan(new ImageSpan(mContext, resId, ImageSpan.ALIGN_BASELINE),
                        start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE );

The result (builder) is set as text to a TextView. It works just fine if the span is surrounded by text, i.e. when the start > 0 and the end < length - 1, but the image is cut off (shifted up) if there is no text around it. how do I fix that?

Thanks a lot.

A: 

Well, as there are no suggestions, I am going to use the following solution in the meantime: if there is no text - use ALIGN_BOTTOM flag, otherwise use ALIGN_BASELINE...

Asahi