Android Percentage Layout Height
There is an attribute called android:weightSum.
You can set android:weightSum="2" in the parent linear_layout and android:weight="1" in the inner linear_layout.
Remember to set the inner linear_layout to fill_parent so weight attribute can work as expected.
Btw, I don't think its necesary to add a second view, altough I haven't tried. :)
<LinearLayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:weightSum="2"> <LinearLayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="1"> </LinearLayout></LinearLayout>
android:layout_weight=".YOURVALUE" is best way to implement in percentage
<?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" > <TextView android:id="@+id/logTextBox" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight=".20" android:maxLines="500" android:scrollbars="vertical" android:singleLine="false" android:text="@string/logText" > </TextView></LinearLayout>