Setting Layout Parameters Programatically
<p>I'm trying to add a scroll view inside another scroll view.</p>

<p>It should look like is this:</p>

<pre><code>scroll view
  linear layout
   myprogramaticscroll view
    myprogramticlinear layout
     myprogramticbutton

     end button
    end layout
   end scroll
  end linear
end scroll
</code></pre>

<p>I'm trying to add scroll views inside of that. It goes in there, but I need to know how to set paramaters correctly so I can see the whole button I have inside of my scroll view. I only see part of it, and i need to set the programatic linear layout and scroll view's width height and id. How do I do this? This is what I have so far:</p>

<pre><code>    //the layout i'm putting my scrollview/linearlayout/button in
    LinearLayout l = (LinearLayout) findViewById(R.id.linearLayoutFavorites);

    ScrollView scroll = new ScrollView(this);
    LinearLayout nl = new LinearLayout(this);

    ImageButton yourButton = new ImageButton(this);

    nl.addView(yourButton);
    scroll.addView(nl);

    l.addView(scroll);
</code></pre>
