WebView加载网页(二)
一、实现目标
1、实现一个页面activity_main.xml,该页面上面有一个TextView和两个WebView,一个WebView显示百度首页,另一个WebView显示另外一个网站的首页。
二、步骤
1、新建项目
使用Android Studio新建一个项目
2、制作页面activity_main.xml
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="3"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textSize="30sp"/>
android:layout_width="match_parent"
android:background="#030303"
/>
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5"
android:id="@+id/webview1"<