webView 组件本身就是一个浏览器实现,它的内核基于WebKit
1.使用WebView浏览网页:
常用方法:
void goBack():后退
void goForward():前进
void loadUrl (String url):加载指定的URL对应的网页
void loadUrl("file:///android_asset/XX.html"):加载本地文件
boolean zoomIn():放大网页
boolean zoomOut():缩小网页
Demo:
显示百度网页
布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation