I am designing an Android interface and I discovered I can give percentage to the control as Weight
.
But when I use the following code :
<LinearLayout
android:orientation="vertical"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="310.1dp"
android:layout_weight=".70"
android:id="@+id/linearLayout1"
android:background="#C49268">
<ImageView
android:src="@android:drawable/ic_menu_gallery"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/imageView1" />
</LinearLayout>
<RelativeLayout
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".30"
android:layout_gravity="bottom"
android:id="@+id/relativeLayout1">
The first layout is taking 70% of the page : android:layout_weight=".70"
The second layout is taking 30% of the page : android:layout_weight=".30"
and a bottom gravity. So it should use the whole page. (100%).
What I understand from this is that the RelativeLayout should take 30% of the bottom space and the LinearLayout should take 70% of the top space for a total of 100% of the screen.
When I boot the app, I still see a black bar at the bottom (unused space). Am I doing something wrong ?