此例在圆形头像上覆盖文字,RoundedImageView为开源圆形图片空间
java:
/**
* 图片上或者空间上覆盖文字(此为圆形图片上)
* Created by yjc on 2017/3/21.
*/
public class AddTextRoundImageView extends RoundedImageView {
private Paint mPaint;
private String str;
public AddTextRoundImageView(Context context) {
super(context);
}
public AddTextRoundImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public AddTextRoundImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
p