title: Android - Programmatically specify height and width of new ScrollView
body: <p>I'm new to Android and I'm working through a tutorial on programmatically creating a layout instead of doing it through the xml, I'm sorta stuck can someone advise please. </p>
  
  <p>So I have a ScrollView then have added a LinearLayout into it, I want both to be a specific size - 480 x 800 (code below). I was able to set the size in the LinearLayout but I cannot get the ScrollView to also be that size but I can't find how to do it. </p>
  
  <p>Is this possible, and can I therefore just specify the ScrollView dimensions and get the subsequent views to inherit that.</p>
  
  <pre><code>ScrollView home_scroll = new ScrollView(this);
  LinearLayout home_linear = new LinearLayout(this);
  home_linear.setOrientation(LinearLayout.VERTICAL);
  
  home_scroll.addView(home_linear, new LinearLayout.LayoutParams(480, 800));
  </code></pre>
  
  <p>Any help would be greatly appreciated, thanks.</p>