android中textview文本的格式化显示.pptxVIP

  • 42
  • 0
  • 约1.76千字
  • 约 8页
  • 2020-06-13 发布于湖北
  • 举报
;字体颜色与超链接;textView2 = (TextView)findViewById(R.id.textview2); //textview2 String text = \n我的URL :\n; text += 我的邮箱:123@163.com\n; text+=我的电话:n; textView2.setText(text); textView2.setMovementMethod(LinkMovementMethod.getInstance());;textView.setTextColor(Color.BLACK); textView.setBackgroundColor(Color.WHITE); textView.setTextSize(20); String html2 = 图像1 img src= style=display: none; img alt=加载中... title=图片加载中... src=/images/s_nopic.gif 图像2 img src= style=display: none;img alt=加载中... title=图片加载中... src=/images/s_nopic.gif图像3img src= style=display: none;img alt=加 载中... title=图片加载中... src=/images/s_nopic.gifp; html2+=图像4img src= style=display: none;img alt=加载中... title=图片加载中... src=/images/s_nopic.gif图像5img src= style=display: none;img alt=加 载中... title=图片加载中... src=/images/s_nopic.gif;; CharSequence charSequence2= Html.fromHtml(html2,new ImageGetter() { public Drawable getDrawable(String source) { //获得系统资源的信息,比如图片信息 Drawable drawable = getResources().getDrawable(getResourceId(source)); // 第三个图片 按50%压缩 if (source.equals(/uploadfile/Collfiles2014041908232829.)) { drawable.setBounds(0, 0, drawable.getIntrinsicWidth()/2, drawable.getIntrinsicHeight()/2); } else { drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); } return drawable; } }, null); textView.setText(charSequence2); textView.setMovementMethod(LinkMovementMethod.getInstance()); ;跑马灯效果;链接弹出Activity;范美英. Android移动应用开发案例教程. 机械工业出版社 /kf/201404/294417.html

文档评论(0)

1亿VIP精品文档

相关文档