Make last view fit to bottom of screen
is there any possibility to change the properties of the last view in the layout to change its size to fit to the bottom of the whole screen (in any screen density).
开发者_JS百科Here is a sample image of my layout:
The layout contains a ScrollView with a LinearLayout as only child. The last item in this LinearLayout is a TableView with a grey gradient as background.
You can try setting layout_height
of your items to "fill_parent"
and change their sizes via changing layout_weight
property, that should work.
If you want the grey part to stick to the bottom you should put weight=1.0 and wrap content for height on the view that is above that one (the white area).
Checked it again on similar layout. The main work does the property android:fillViewport="true"
Which
Defines whether the scrollview should stretch its content to fill the viewport
More infos: ScrollView.html#attr_android:fillViewport
精彩评论