喜糖

移动开发工程师 。涉及 android、ios、jni

导航

scrollView的fillviewport

Posted on 2011-11-24 14:22  喜糖  阅读(2506)  评论(0编辑  收藏  举报

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的高度时,这个标签就没有任何意义了。