Android ScrollView无法填充满屏幕的解决办法

  

<强> Android ScrollView无法填充满屏幕的解决办法

  

ScrollView滚动视图是指当拥有很多内容,屏幕显示不完时,需要通过滚动跳来显示的视图,滚动视图的一般用法如下

  

以下代码在滚动视图里面放了一个使用,并且是设置为“填充全屏的和RelativeLayout里面放置了一个TextView背景设为了一张图片,按照代码理解,图片应该是居于屏幕的最下方的
  

        & lt;滚动视图   android: layout_width=" match_parent "   android: layout_height=癿atch_parent”比;      & lt;使用   android: layout_width=" match_parent "   android: layout_height=" match_parent "   android:背景=癅color/common_background”比;      & lt; TextView   android: layout_width=" wrap_content "   android: layout_height=" wrap_content "   android: layout_centerHorizontal=" true "   android: layout_alignParentBottom=" true "   android:背景=癅drawable/bottom_bg”/比;      & lt;/RelativeLayout>   & lt;/ScrollView>      之前      

但是最后运行的效果是这样的,你会发现图片并没有局到整个屏幕的下边,而是在上面滚动视图无法填充满屏幕,

  

 Android ScrollView无法填充满屏幕的解决办法

  

那么要怎么解决这个问题呢,最后我在查看文档的时候发现了这样一个属性,设置了就可以解决这个问题了
  

        & lt;滚动视图   android: layout_width=" match_parent "   android: layout_height=" match_parent "   android: fillViewport=" true "比;      & lt;/ScrollView>      之前      

也就是说设置<强>滚动视图的android: fillViewport为真,即android: fillViewport=" true "即可

  

  

Android ScrollView无法填充满屏幕的解决办法