TextView图文混排第反应肯定使用ImageSpan,问题是这个坑爹的方法有
/**
* A constant indicating that the bottom of this span should be aligned
* with the bottom of the surrounding text, i.e., at the same level as the
* lowest descender in the text.
*/
public static final int ALIGN_BOTTOM = 0;
/**
* A constant indicating that the bottom of this span should be aligned
* with the baseline of the surrounding text.
*/
public static final int ALIGN_BASELINE = 1;
这2个方法,就是没有居中对齐。并且TextView只要设置了行距,那显示效果真的是日了狗了。so 不得已查看了源码DynamicDrawableSpan这个类,发现其中2个重要的方法:
@Override
public int getSize(Paint paint, CharSequence text,