我是Android的初学者,linear layout
在这样的布局XML文件中构建并获得错误,
错误
Placing a <WebView> in a parent element that uses a wrap_content size can lead to subtle bugs; use match_parent
Run Code Online (Sandbox Code Playgroud)
错误显示在代码的这一部分中
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/browse"
/>
Run Code Online (Sandbox Code Playgroud)
这是我的XML文件的完整代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="100" >
<EditText
android:id="@+id/url"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="70"
android:ems="10" >
</EditText>
<Button
android:id="@+id/go"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="30"
android:text="GO" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="8"
>
<Button
android:id="@+id/backpage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="Go Back" />
<Button
android:id="@+id/forwardpage"
android:layout_width="wrap_content"
android:layout_height="wrap_content" …
Run Code Online (Sandbox Code Playgroud)