前段时间设置ScrollView下的LinearLayout下设置LayoutParam不起作用,假如是horizontal的ScrollView则param.height设置不起作用,vertical的ScrollView则param.width设置不起作用,原因是在LinearLayout需要在FrameLayout下才能起作用:
<ScrollView
android:id="@+id/homepage_scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/homepage_scrollView_linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
不然不起作用,原因找了很久,在此记录一下!!!