在半屏幕上的Android web视图

Tom*_*i S 4 android webview

我只想这样做,但我不知道怎么做.这将是垂直线性布局.我搜索了3个小时,但还没有找到任何有用的东西.

Mat*_*att 7

设置您的子视图的权重相等,应均匀分割:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <WebView 
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />

    <Space
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)