private void setImageText()
	{
		//根据ID获取图像的Bitmap对象
		Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
		//创建imageSpan对象
		ImageSpan imageSpan = new ImageSpan(this, bitmap);
		//创建一个SpannableString对imageSpan进行封装
		SpannableString spannableString = new SpannableString("icon哇咔咔");
		//用ImageSpan对象替换icon
		spannableString.setSpan(imageSpan, 0, 4, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
		tv_hello.setText(spannableString);
	}

posted on 2013-05-12 17:32  纯洁的坏蛋  阅读(256)  评论(0编辑  收藏  举报