1

 setContentView
(R.layout.main);

WebView view=new WebView(this);
view.setVerticalScrollBarEnabled(false);

((
LinearLayout
)findViewById(R.id.inset_web_view)).addView(view);
view
.loadData(getString(R.string.hello),"text/html", "utf-8");

<string 
name="hello">
<![CDATA[

<html><head></head>
<bodystyle="text-align:justify;color:gray;background-color:black;">
Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Nunc pellentesque, urna
nec hendrerit pellentesque, risus mass

</body>
</html>]]></string>




2:

 
Spanned
content = Html.fromHtml
(
"<div style=/"text-align:justify/">" + bundle.getString(CONTENT) +"<//div>");

TextView txtContent =(TextView) findViewById(R.id.txtNewsDetail);

txtContent.setText(content.toString(), BufferType.SPANNABLE);





更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. android之AsncTask异步任务使用
  2. android aapt使用小结
  3. Android(安卓)SharedPreferences一般的读
  4. Android(安卓)Camera照相机
  5. Android(安卓)ClickableSpan 应用实例
  6. Android(安卓)微博布局风格
  7. android inport apiDemos
  8. android软键盘的显示与隐藏
  9. 【Android外文翻译 - 03】创建可复用的UI
  10. Android(安卓)Multiple APK Support