首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

在TextView中安插图片

2012-09-04 
在TextView中插入图片setContentView(R.layout.main)TextView textView (TextView) findViewById(R.id.t

在TextView中插入图片

setContentView(R.layout.main);               TextView textView  = (TextView) findViewById(R.id.textview);  SpannableString ss = new SpannableString("abc");  Drawable d = getResources().getDrawable(R.drawable.icon32);  d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());  ImageSpan span = new ImageSpan(d, ImageSpan.ALIGN_BASELINE);  ss.setSpan(span, 0, 3, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);  textView.setText(ss);
?

热点排行