为什么我的ScrollView滚动显示不到最后?
为什么我的ScrollView滚动显示不到最后的“我的设置” 但是把ScrollView高度固定一个值就能显示
1
收起
正在回答
3回答
我认为,这个问题的原因是 scrollView 按照全部屏幕大小在滑动,没有考虑到最下面功能菜单区。也就说,功能菜单区盖住了ScrollView的区域。可以在最下面加一个 高度定值的空白控件,这样可以避免这个问题。
1 2 3 4 5 6 7 | <LinearLayout android:layout_width= "match_parent" android:layout_height= "100dp" android:orientation= "horizontal" android:layout_marginTop= "10dp" android:layout_marginLeft= "10dp" android:layout_marginStart= "10dp" > |
1 | <br> |
irista23
2019-01-08 17:30:58
如果是用线性布局作为最外层布局,里面设置垂直排列的两块区域,一个是内容区放你的fragment,下面一个是功能菜单区,结构参考如下代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | < LinearLayout android:layout_width = "match_parent" android:layout_height = "match_parent" android:orientation = "vertical" ……> <!--内容--> < RelativeLayout android:id = "@+id/container_content" android:layout_width = "match_parent" android:layout_height = "wrap_content" android:layout_weight = "1" > </ RelativeLayout > <!--功能菜单--> < LinearLayout android:id = "@+id/container_menu" android:layout_width = "match_parent" android:layout_height = "wrap_content" android:orientation = "horizontal" android:background = "#ffffff" android:layout_alignParentBottom = "true" > …… </ LinearLayout > </ LinearLayout > |
Android零基础入门2018版
- 参与学习 人
- 提交作业 5461 份
- 解答问题 7235 个
此次推出的专题为Android攻城狮培养计划的第一部分语法与界面基础篇,将带大家从0开始学习Android开发。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧