1. 程式人生 > >ScrollView子佈局填滿整個螢幕

ScrollView子佈局填滿整個螢幕

ScrollView直接子View只能有一個,一般高度是自適應內容高度,可能會遇到不能填滿整個螢幕的情況,那麼解決辦法就是增加一個屬性:

 android:fillViewport="true" 

程式碼:

<pre name="code" class="java"><ScrollView  
  xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:fillViewport="true" >
<ScrollView/>