1、布局文件

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity"> <WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent">
</WebView> </RelativeLayout>

2、代码

package com.webview.demo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.webkit.WebView; public class MainActivity extends AppCompatActivity { private WebView webView ; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); String webs = "\"<table style='font-size:12px;'><tr><td style='width:45px;'>" +
"起&nbsp;&nbsp;息&nbsp;&nbsp;日:</td><td>当日22:00前投资," +
"当日计息</td></tr><tr><td>还&nbsp;&nbsp;款&nbsp;&nbsp;日:</td><td>每日7点</td></tr><tr><td>还款方式:" +
"</td><td>按日付息</td></tr></table>\"" ; webView = (WebView) findViewById( R.id.webview ); //webview
webView.loadDataWithBaseURL( null, webs , "text/html", "UTF-8", null ) ; }
}

3、显示效果

最新文章

  1. 熟悉HTML CSS布局模型
  2. ASP.NET Core (Database First)
  3. windows 下 gvim打开默认全屏显示
  4. tc 146 2 RectangularGrid(数学推导)
  5. IOS 蓝牙相关-BabyBluetooth蓝牙库介绍(4)
  6. Linq ExecuteQuery,ExecuteCommand
  7. 机器人学 —— 机器人感知(Kalman Filter)
  8. C# 将字符串转化成流,将流转换成字符串
  9. SAP-设置显示表格格式
  10. hdu 2012 素数判定 Miller_Rabbin
  11. SQL入门学习4-复杂查询
  12. 51 Nod 1119
  13. [ffmpeg] AVOption
  14. for in 循环 和for循环 for of循环
  15. advancedsearch.php织梦高级自定义模型字段无法调用解决方案
  16. 使用SpringBoot Admin监控SpringCloud微服务
  17. HDU 6300
  18. 九浅一深ThreadLocal
  19. Java 集合系列Stack详细介绍(源码解析)和使用示例
  20. JAVA-JSP内置对象之request获得所有的参数名称

热门文章

  1. jQuery 3.1 API中文文档
  2. 【分享】学长的安利来了~~O(∩_∩)O
  3. 【Android学习笔记】XmlResourceParser解析xml文件
  4. JS 实现可停顿的垂直滚动
  5. Spring @Transactional propagation 各个属性值的含义
  6. Android对话框自定义标题
  7. 蘑菇街2015校招 Java研发笔试题 详解
  8. ViewPager的刷新、限制预加载、缓存所有
  9. android 歌词解析
  10. IO流(一)__File对象和字符流FileWriter FileReader