【发布时间】:2015-07-12 09:28:45
【问题描述】:
我已经尝试了所有方法,但我的 ScrollView 在我的活动中不起作用。我有活动在用户单击按钮后打开一个表。我找不到我的表格双向滚动的方式。如何以编程方式制作 ScrollView?我的代码:
TableLayout tableLayout = new TableLayout(getApplicationContext());
tableLayout.setVerticalScrollBarEnabled(true);
tableLayout.setBackgroundColor(Color.WHITE);
TableRow tableRow;
TextView textView,...
tableRow = new TableRow(getApplicationContext());
textView=new TextView(getApplicationContext());
textView.setText("Date");
textView.setTextColor(Color.BLACK);
textView.setTypeface(null, Typeface.BOLD);
textView.setPadding(20, 20, 20, 20);
tableRow.addView(textView);
tableLayout.addView(tableRow);
for (Integer j = 0; j < count; j++)
{
tableRow = new TableRow(getApplicationContext());
textView1 = new TextView(getApplicationContext());
....
tableLayout.addView(tableRow);
c.moveToNext() ;
}
c.close();
setContentView(tableLayout);
database.close();
【问题讨论】:
标签: java android scrollview tablelayout