Romain Guy write a little info about a ScrollView attribute that is missing from documentation : android:fillViewport=”true” .
It must be set to ScrollView and has the following efect : when set to true, this attribute causes the scroll view’s child to expand to the height of the ScrollView if needed. When the child is taller than the ScrollView, the attribute has no effect.
当你想让一个高度值不足scrollview的子控件fillparent的时候,单独的定义android:layout_height="fill_parent"是不起作用的,必须加上fillviewport属性,当子控件的高度值大于scrollview的高度时,这个标签就没有任何意义了。
本文介绍了一个ScrollView属性:fillViewport。当设置为true时,此属性可以使ScrollView的子元素扩展到ScrollView的高度,前提是子元素的高度小于或等于ScrollView的高度。这对于希望子元素填满父元素高度的情况特别有用。
1561

被折叠的 条评论
为什么被折叠?



