TextView tv = (TextView)findViewById(R.id.textView1); //重载ImageGetter接口 Html.ImageGetter imgGetter = new Html.ImageGetter() { public Drawable getDrawable(String source) { Drawable drawable=null; int rId=Integer.parseInt(source); drawable=getResources().getDrawable(rId); drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); return drawable; }; }; tv.setText(Html.fromHtml("<img src='"+R.drawable.ic_launcher+"'/>123",imgGetter,null));
by: 发表于:2018-01-02 10:01:44 顶(0) | 踩(0) 回复
??
回复评论