Generally speaking, you want to avoid using dimensions for widget sizes. There will be cases when it is unavoidable, or even advisable, but it is difficult to create "fluid" layouts that way.
If you want widgets that take up a certain percentage of the screen, use LinearLayout
and android:layout_weight
, using the weights to allocate the available space:
<?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">
<Button
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="50"
android:text="@string/fifty_percent"/>
<Button
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="30"
android:text="@string/thirty_percent"/>
<Button
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="20"
android:text="@string/twenty_percent"/>
</LinearLayout>