title: Changing scrollview's position in Android
body: <p>I'm writing an Android application that has a scrollview which contains a linearlayout:</p>
  
  <pre><code>&lt;ScrollView android:id="@+id/ScrollView01"
          android:layout_width="fill_parent" 
          android:layout_height="fill_parent"  
          android:layout_gravity=top"
          android:layout_marginTop="240dip"
          android:layout_marginRight="0dip"
          android:layout_marginBottom="60dip"&gt;
  
           &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/centerlayout"
          android:orientation="vertical"
          android:layout_width="fill_parent" 
                  android:layout_height="fill_parent" 
                  android:layout_gravity="top"
                  android:layout_marginRight="20dip"
                  android:layout_marginLeft="10dip"
              android:layout_marginBottom="120dip"&gt;
  </code></pre>
  
  <p>As you see, scrollview's margin top is "240dip" . I want to be able to change it in my Java code. I tried this:</p>
  
  <pre><code>ScrollView scrollView=(ScrollView)findViewById(R.id.ScrollView01);
  LayoutParams  params=scrollView.getLayoutParams();
  </code></pre>
  
  <p>But I can't do this: params.top=100; Would you please help me how I can do it?</p>