android - IconMarginSpan text does not wrap. Use DynamicDrawableSpan and ImageSpan icons to have no margins.
ringa_lee
ringa_lee 2017-05-24 11:38:14
0
1
1408

IconMarginSpan has very few methods. Does the chooseHeight method have this effect? ​​How can I change it to set DynamicDrawableSpan#ALIGN_BASELINE like DynamicDrawableSpan and ImageSpan so that the following text can wrap?

public void chooseHeight(CharSequence text, int start, int end,
                             int istartv, int v,
                             Paint.FontMetricsInt fm) {
        if (end == ((Spanned) text).getSpanEnd(this)) {
            int ht = mBitmap.getHeight();

            int need = ht - (v + fm.descent - fm.ascent - istartv);
            if (need > 0)
                fm.descent += need;

            need = ht - (v + fm.bottom - fm.top - istartv);
            if (need > 0)
                fm.bottom += need;
        }
    }

Add a space. . . . . . That’s it

ringa_lee
ringa_lee

ringa_lee

reply all(1)
曾经蜡笔没有小新

Add a space. . . . . . That’s it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template