I have a layout like in calculator , 4 buttons in each row , with some 5 rows. I created these each row by using LinearLayout
. I had managed to fill width of each row completely by using android:layout_weight="1"
in each button in LinearLayout
. But i don't know how to fill the vertical space in this way. After five rows there's space remaining at the bottom for Normal XDPI screens(Nexus 4)
<LinearLayout
android:id="@+id/first_row"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/entry">
<Button
android:id="@+id/seven"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="7"
android:textColor="@color/Blue_ICS"
android:textSize="@dimen/button_text_size"
/>
<Button
android:id="@+id/eight"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="8"
android:textColor="@color/Blue_ICS"
android:textSize="@dimen/button_text_size"/>
<Button
android:id="@+id/nine"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="9"
android:textColor="@color/Blue_ICS"
android:textSize="@dimen/button_text_size"/>
<Button
android:id="@+id/plus"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="+"
android:textColor="@color/Blue_ICS"
android:textSize="@dimen/button_text_size"/>
</LinearLayout>
The layout is too long so i share here code of only first row, remaining rows are same too.