TextView 文字图片混合显示

String html = "办税服务网点("+listSpinner.get(pos)+")";
				CharSequence charSequence = Html.fromHtml(html+"<img />", new ImageGetter() {

					@Override
					public Drawable getDrawable(String source) {
						// TODO Auto-generated method stub
						// 获得系统资源的信息,比如图片信息
						Drawable drawable = getResources().getDrawable(R.drawable.spinner);  // Or fetch it from the URL
						drawable.setBounds(0, 0, drawable.getIntrinsicWidth(),
									drawable.getIntrinsicHeight());
						return drawable;
					}
				}, null);
				
				txtView.setText(charSequence);

 

更多参考:http://my.oschina.net/javagg/blog/27834

你可能感兴趣的:(textview)