Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android web view on half screen

I just want to do that but i don't know how. This would be in vertical linear layout. I have searched for 3 hours and haven't found nothing useful yet.

like image 537
Tomi S Avatar asked Dec 28 '22 07:12

Tomi S


1 Answers

Setting your child View's weights equal to each other should split them evenly:

<?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>
like image 68
Matthew Avatar answered Jan 06 '23 12:01

Matthew