getting the layout weights right
<p>Need help with a layout xml. When I test the below dimensions for the below xml layout in my code for height of textview(by using textview.getHeight) versus height of screen(by DisplayMetrics.getMetrics()), it comes as 78.9%, meaning the height of textview is 78.9% of screenheight. I was expecting this should be 90% as I have assigned weight 1 and 9 to my two relativelayouts which have textview and other components(buttons) respectively. Can anyone please help. My objective was to make the textview 10% of the screenheight.</p>

<pre><code>&lt;LinearLayout 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"
android:orientation="vertical"
tools:context=".Story1Activity" &gt;

&lt;RelativeLayout
    android:layout_weight="1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"&gt;
    &lt;TextView
        android:id="@+id/textViewStory1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:lineSpacingMultiplier="1.2" /&gt;
&lt;/RelativeLayout&gt;

&lt;RelativeLayout
    android:layout_weight="9"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"&gt;

    &lt;Button
        android:id="@+id/buttonPrevious"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_alignParentLeft="true"
        android:background="@android:drawable/btn_default"
        android:text="@string/stringButtonPrevious"
        android:onClick="loadPrevious" /&gt;

    &lt;Button
        android:id="@+id/buttonNext"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_alignParentRight="true"
        android:background="@android:drawable/btn_default"
        android:text="@string/stringButtonNext" 
        android:onClick="loadNext"/&gt;
</code></pre>

<p></p>

<p></p>
