Adding scrollview to layout using java code
<p>I have created following layout.which has two relative layouts and one scrollview ,following code contains headings of the layout.The I need to create sheet where i will use loop.</p>

<pre><code>  RelativeLayout inner=new RelativeLayout(this);
  inner.setBackgroundColor(Color.RED);
  outerLayout=new RelativeLayout(this);
  ScrollView scroll=new ScrollView(this);
  TextView qty=new TextView(this);
  qty.setId(1111);
  inner.addView(qty);
  qty.setTextColor(Color.WHITE);
  qty.setText("Qty");

  setContentView(outerLayout); 
  RelativeLayout.LayoutParams p=new          RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,30);
  p.addRule(RelativeLayout.RIGHT_OF,qty.getId())

    ;
   p.leftMargin=30;

    TextView partNo=new TextView(this);
    partNo.setText("Part no");
    partNo.setId(2222);
    partNo.setLayoutParams(p);
    partNo.setTextColor(Color.WHITE);


    inner.addView(partNo);

    RelativeLayout.LayoutParams descLayout=new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,30);
    descLayout.addRule(RelativeLayout.RIGHT_OF,partNo.getId())

    ;
    descLayout.leftMargin=30;

    TextView desc=new TextView(this);
    desc.setText("Description");
    desc.setId(3333);
    desc.setLayoutParams(descLayout);
    desc.setTextColor(Color.WHITE);


    inner.addView(desc);


    RelativeLayout.LayoutParams commentLayout=new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,30);
    commentLayout.addRule(RelativeLayout.RIGHT_OF,desc.getId())

    ;
    commentLayout.leftMargin=30;

    TextView comment=new TextView(this);
    comment.setText("Comments");
    comment.setId(4444);
    comment.setLayoutParams(commentLayout);
    comment.setTextColor(Color.WHITE);


    inner.addView(comment);


    RelativeLayout.LayoutParams retailLayout=new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,50);
    retailLayout.addRule(RelativeLayout.RIGHT_OF,comment.getId())

    ;
    retailLayout.leftMargin=30;

    TextView retail=new TextView(this);
    retail.setText("Retail \n Reference");
    retail.setId(5555);
    retail.setLayoutParams(retailLayout);
    retail.setTextColor(Color.WHITE);


    inner.addView(retail);
    scroll.setVerticalScrollBarEnabled(true);
    scroll.setHorizontalScrollBarEnabled(true);


    scroll.addView(inner);

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

<p>I tried to add scroll view to the layout but unfortunately i am unable to see the scrollview .Please help that how can i add the scrollview to above layout.</p>
