开发者

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:

Make last view fit to bottom of screen

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜