Friday, 13 September 2013

How to place table layout below Linear layout programmatically in android

How to place table layout below Linear layout programmatically in android

Here is my code to display table layout below linear layout.here i am
setting scroll view as contentview.but only table layout displaying on
screen.here any problem in layout.please help me thanks.
ScrollView scrollView = new ScrollView(this);
LinearLayout ll = new LinearLayout(getApplicationContext());
ll.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
Button btn1 = new Button(this);
btn1.setText("Button1");
ll.addView(btn1);
btn1.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
TableLayout resultLayout = new TableLayout(this);
resultLayout.setStretchAllColumns(true);
resultLayout.setShrinkAllColumns(true);

No comments:

Post a Comment