Android ScrollView无法填充满屏幕的解决办法
2017-07-23 15:11
801 查看
Android ScrollView无法填充满屏幕的解决办法
ScrollView滚动视图是指当拥有很多内容、屏幕显示不完时、需要通过滚动跳来显示的视图、Scrollview的一般用法如下
以下代码在Scrollview里面放了一个RelativeLayout、并且是设置为Android:layout_height="match_parent"填充全屏的和RelativeLayout里面放置了一个TextView背景设为了一张图片、按照代码理解、图片应该是居于屏幕的最下方的
<ScrollView android:layout_width="match_parent" android:layout_height="match_parent" > <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/common_background" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_alignParentBottom="true" android:background="@drawable/bottom_bg" /> </RelativeLayout> </ScrollView>
但是最后运行的效果是这样的、你会发现图片并没有局到整个屏幕的下边、而是在上面ScrollView无法填充满屏幕,
那么要怎么解决这个问题呢、最后我在查看文档的时候发现了这样一个属性、设置了就可以解决这个问题了
<ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" > </ScrollView>
也就是说设置ScrollView的android:fillViewport为true、即 android:fillViewport="true"即可。
您可能感兴趣的文章:
相关文章推荐
- Android Recycler View解决item宽度无法填充屏幕(没有父容器参数也行)
- Android中ScrollView与listView冲突以及ScrollView与listView无法滑动(拖动)解决办法
- android scrollView 内部子布局MATCH_PARENT却无法填充满屏幕问题
- Android GridView无法填充Activity的解决办法
- android scrollView 内部子布局MATCH_PARENT却无法填充满屏幕问题
- 安卓添加外部Library报NoClassDefFoundError异常,无法生成Android Dependencies目录,一种简单解决办法
- Android 软件盘始终无法隐藏解决办法
- Ubuntu 下 Android SDK Manager 被 GFW 无法更新的解决办法
- Android开发,超出屏幕范围的控件显示解决办法
- android Encrypt/Decrypt Strings 在4.2中无法解密解决办法
- android程序卸载后无法删除桌面快捷方式的解决办法
- Android WebView无法弹出软键盘的原因及解决办法
- android apk异常卸载后无法安装的解决办法
- Android无法生成R文件的终极解决办法
- Android中ScrollView中嵌套RecyclerView的完美解决办法
- 有些品牌Android真机无法打印log解决办法
- Android Scrollview 内部组件android:layout_height="fill_parent"无效的解决办法
- android工程gen目录无法生成的解决办法汇总
- 关于ScrollView里面包裹LinearLayout 设置权重 填充满屏幕无效问题解决方法
- Android—使用Activitygroup或者TabActivity中包含其它的activity无法定位的解决办法