I have a layout that contains three rows or segments in my Android view.
The first layout region has a fixed height based upon the content of the region with a:layout_height=”wrap_content”.
The next segment will contain a ListView with it’s built in scrolling capability, I would like this to take up the available screen real-estate.
The final segment will always have a fixed height based upon an absolute value or a:layout_height=”32dp”. I would like this thrid segment “docked” to the bottom of the view.
For reference the following XAML accomplishes what I want
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
<RowDefinition Height="32" />
</Grid.RowDefinisions>
</Grid>
Is this possible via android layout XML? And if so how can this be done.
Set
android:layout_height=”fill_parent”,
android:layout_height=”match_parent”
or
android:layout_weight=”1″.
The latter will take all of the remaining unused space in its parent layout, the former will sometimes force other elements out of view.