您的位置:首页 > 移动开发 > Android开发

android中RelativeLayout无法填充ScrollView布局的问题

2015-11-20 14:40 531 查看
ScrollView是解决布局过长的情况下使用,一遍其下面会有个顶部布局,我项目里面是RelativeLayout,但是RelativeLayout无论设置

android:layout_height="wrap_content"


还是

android:layout_height="match_content"


都无法解决RelativeLayout填充ScrollView整过view的情况,后来百度了下,发现在scrollview添加如下android:fillViewport="true"代码可以解决。

当ScrollView没有fillVeewport=“true”时,里面的元素(比如LinearLayout)会按照wrap_content来计算(不论它是否设了"fill_parent")
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: