當(dāng)ScrollView里的元素想填滿ScrollView時(shí),使用"fill_parent"或者"match_parent"是不管用的,必需為ScrollView設(shè)置:android:fillViewport="true"。
當(dāng)ScrollView沒有fillVeewport=“true”時(shí), 里面的元素(比如LinearLayout)會(huì)按照wrap_content來計(jì)算(不論它是否設(shè)了"fill_parent"或者"match_parent"),而如果LinearLayout的元素設(shè)置了fill_parent,那么也是不管用的,因?yàn)長(zhǎng)inearLayout依賴?yán)锩娴脑?,而里面的元素又依賴LinearLayout,這樣自相矛盾.所以里面元素設(shè)置了fill_parent,也會(huì)當(dāng)做wrap_content來計(jì)算.