- 新建一个Activity,引入WebView组件和两个测试button,布局如下:
<?xml version="1.0" encoding="utf-8"?>
<WebView
android:id="@+id/webView"
android:layout_width="wrap_content"
android:layout_height="500px">
</WebView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/test_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="test_one"
android:textAllCaps="false"/>
<Button
android:id="@+id/test_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"