[Android Pro] ScrollView使用fillViewport设置高度为MatchParent

reference to : http://blog.csdn.net/u012975705/article/details/49275001

之前遇到一问题,就是当使用ScrollView时,ScrollView控件里的布局无法充满整个手机屏幕,通过阅读源码发现,ScrollView中有个mFillViewport属性:

这里写图片描述

When set to true, the scroll view measure its child to make it fill the currently visible area

大概意思就是当mFillViewport设置为true的时候,其子视图能够自动填充满当前可见的整个区域。即,在xml布局文件中为ScrollView控件添加

android:fillViewport="true"
能使ScrollView里的元素填满整个ScrollView。
 
posted @ 2016-11-09 20:42  demoblog  阅读(1213)  评论(0编辑  收藏  举报