I have a LinearLayout
inside of a Scrollview
. After doing some animations, there is blank space at the bottom when I scroll down. So I want to resize the LinearLayout
using this code
ViewGroup.LayoutParams params = _linearLayoutMainWrapper.getLayoutParams();
params.height = 100;
_linearLayoutMainWrapper.setLayoutParams(params);
It doesnt work though, just nothing is happening. When I try to resize the width
it is working though.
The XML is
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:fillViewport="true"
android:id="@+id/scrollViewMain">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:orientation="vertical"
android:paddingLeft="16dip"
android:paddingRight="16dip"
android:id="@+id/linearLayoutMainWrapper">
<!-- a lot of stuff -->
</LinearLayout>
</ScrollView>