这是我以编程方式在滚动视图底部显示按钮的代码。但仅显示滚动视图。按钮未显示在屏幕上。如何解决此问题。
LinearLayout ll = new LinearLayout(this);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
ll.setLayoutParams(lp);
ScrollView scrollView = new ScrollView(this);
TableLayout resultLayout = new TableLayout(this);
resultLayout.setStretchAllColumns(true);
resultLayout.setShrinkAllColumns(true);
scrollView.addView(resultLayout);
ll.addView(scrollView);
Button btn = new Button(this);
ViewGroup.LayoutParams blp = new ViewGroup.LayoutParams(
LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT);
btn.setLayoutParams(blp);
btn.setText("Click Me");
//ll.addView(rl1);
ll.addView(btn);
setContentView(ll);
滚动视图的屏幕,其中包含