Android带图片的textView

来源:互联网 发布:易语言手机版远控源码 编辑:程序博客网 时间:2024/04/30 15:13
text = (TextView) findViewById(R.id.TextView01);
ImageSpan span = new ImageSpan(this, R.drawable.ic_launcher);// 加载图片的资源
SpannableString spanStr = new SpannableString("请看图片");
spanStr.setSpan(span, spanStr.length() - 1, spanStr.length(),
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
text.setText(spanStr);
0 0
原创粉丝点击