defining UI component's height as percentage(or relative) to screen height
<p>Need some help with a UI problem in android. I am trying to create an activity where a text view is supposed to fill all the space above the two buttons on the bottom right and bottom left.
<img src="http://i.stack.imgur.com/eAyKb.jpg" alt="layout"></p>

<p>I don't want to hardcode any height/width parameters but want to define them as %. So I want button height to be 10% of the screen height and the textview to be 90% of the screenheight. </p>

<p>Hence I keep button width as Wrap_text and the textview width as fill_parent.</p>

<p>Below is the xml file as I have it as of now. The problem is in defining the height. How do i specify button height as 10% of screenheight and/or textview height as 90% of screen height?</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Activityclass" &gt;

&lt;TextView
 android:id="@+id/textView1"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:layout_above="@+id/button1" /&gt;

&lt;Button
 android:id="@+id/button1"
 style="?android:attr/buttonStyleSmall"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_alignParentBottom="true"
 android:layout_alignParentLeft="true"
 android:background="@android:drawable/btn_default"
 android:text="&lt;-prev" /&gt;

&lt;Button
 android:id="@+id/button2"
 style="?android:attr/buttonStyleSmall"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_alignParentBottom="true"
 android:layout_alignParentRight="true"
 android:background="@android:drawable/btn_default"
 android:text="next-&gt;" /&gt;
</code></pre>

<p></p>

<p>Any help will be most welcome.</p>
