android WebView渲染html
16lz
2021-01-23
xml文件中:
<WebView
android:id="@+id/wv"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/hello"/>
java文件中:
WebView webView= (WebView) this.findViewById(R.id.wv);
//要解析的HTML字符串
final String htmlText = "" +
"" +
"" +
"
" +
"" +
" +
" " + " +
"" +
"" + vStr +"
" + vNum +
"
"
"" +
"";
//最后一击!
webView.loadDataWithBaseURL("about:blank", htmlText, "text/html", "utf-8", null);
更多相关文章
- Android 平台根目录文件
- Android string.xml文件中使用格式化符号%
- Android下文件资源管理器雏形实现
- 阿里Android开发规范:文件与数据库
- Cocos2dx播放mp4文件(IOS和Android)
- Android——文件存储之外部存储(含源码下载)