i have three lists with the same number of elements in each other, i want to put first element of all lists in a tablerow, then second element of all lists in another tablerow,
the lists are :
competitoinsIDs = new LinkedList<String>();
marks = new LinkedList<String>();
numOfQuestions = new LinkedList<String>();
so i use this function:
private void addTextViews() {
// TODO Auto-generated method stub
TableLayout tbl=(TableLayout) findViewById(R.id.tlMarksTable);
for(int ctr=0;ctr<marks.size();ctr++)
{
//Creating new tablerows and textviews
TableRow row=new TableRow(this);
TextView txt1=new TextView(this);
TextView txt2=new TextView(this);
TextView txt3=new TextView(this);
//setting the text
txt1.setText(competitoinsIDs.get(ctr));
txt2.setText(marks.get(ctr));
txt3.setText(numOfQuestions.get(ctr));
//the textviews have to be added to the row created
row.addView(txt1);
row.addView(txt2);
row.addView(txt3);
tbl.addView(row);
}
}
and this is the layout xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
android:id="#+id/tlMarksTable"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:weightSum="2" >
<TextView
android:id="#+id/tvMarksCompetitionID"
android:layout_weight="1"
android:text="Competition"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/tvMarksMarks"
android:layout_weight="1"
android:text="Marks"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/tvMarksQuestionsNum"
android:layout_weight="1"
android:text="Questions"
android:textAppearance="?android:attr/textAppearanceMedium" />
</TableRow>
</TableLayout>
</FrameLayout>
what am i doing wrong please ?
The problem is that you don't set proper LayoutParams on the TableRows and TextView that you add to the layout:
private void addTextViews() {
TableLayout tbl=(TableLayout) findViewById(R.id.tlMarksTable);
for(int ctr=0;ctr<marks.size();ctr++) {
TableRow row=new TableRow(this);
TableLayout.LayoutParams tlp = new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT);
TextView txt1=new TextView(this);
TableRow.LayoutParams text1lp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT);
TextView txt2=new TextView(this);
TableRow.LayoutParams text2lp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT);
TextView txt3=new TextView(this);
TableRow.LayoutParams text3lp = new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT);
txt1.setText(competitoinsIDs.get(ctr));
txt1.setLayoutParams(text1lp);
txt2.setText(marks.get(ctr));
txt2.setLayoutParams(text2lp);
txt3.setText(numOfQuestions.get(ctr));
txt3.setLayoutParams(text3lp);
row.addView(txt1);
row.addView(txt2);
row.addView(txt3);
row.setLayoutParams(tlp);
tbl.addView(row);
}
}
This is assuming that your data lists aren't empty.
ADD as TableRow and TextView To TableLayout :
for(int ctr=0;ctr<marks.size();ctr++)
{
//YOUR CODE....
TableRow row=new TableRow(this);
row.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
TextView txt1=new TextView(this);
txt1.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
TextView txt2=new TextView(this);
txt1.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
TextView txt3=new TextView(this);
txt3.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
//YOUR CODE....
}
Related
In my android app, I have a table layout. I want to dynamically insert rows. But the problem is the rows are being added horizontally. I want each tablerow to be stacked vertically. I have this so far:
TableLayout mytable = (TableLayout)findViewById(R.id.studentContainer);
TableRow tablerow = new TableRow(this);
tablerow.setOrientation(TableRow.VERTICAL);
EditText g = new EditText(this);
g.setText("AAAAAAAAA");
g.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
EditText g2 = new EditText(this);
g2.setText("BBBBBBBBBB");
g2.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
tablerow.addView(g);
tablerow.addView(g2);
mytable.addView(tablerow, new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT));
TableRow tablerow2 = new TableRow(this);
tablerow2.setOrientation(TableRow.VERTICAL);
EditText g4 = new EditText(this);
g4.setText("AAAAAAAAA");
g4.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
EditText g5 = new EditText(this);
g5.setText("BBBBBBBBBB");
g5.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
tablerow.addView(g4);
tablerow.addView(g5);
mytable.addView(tablerow2, new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT));
XML
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/studentContainer" >
</TableLayout >
Does anyone know whats wrong here?
Thanks
Try to put the first row in the xml and rotate the entire table, edit the text_views if necessary. Like this
XML
<TableLayout
android:id="#+id/list_tableLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:rotation="-90"
android:stretchColumns="0,1,2,3" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Column1"
android:textColor="#000000"/>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Column2"
android:textColor="#000000"/>
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Column3"
android:textColor="#000000"/>
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Column4"
android:textColor="#000000"/>
</TableRow>
</TableLayout>
and then code like this
TableRow tr = new TableRow(this);
tr.setPadding(0,20,0,20);
tr.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
TextView tv_item1 = new TextView(this);
TextView tv_item2 = new TextView(this);
TextView tv_item3 = new TextView(this);
TextView tv_item4 = new TextView(this);
tv_item1.setText(M_Number);
tv_item1.setGravity(Gravity.CENTER);
tv_item2.setText(M_Number);
tv_item2.setGravity(Gravity.CENTER);
tv_item3.setText(M_Number);
tv_item3.setGravity(Gravity.CENTER);
tv_item4.setText(M_Number);
tv_item4.setGravity(Gravity.CENTER);
tr.addView(tv_item1);
tr.addView(tv_item2);
tr.addView(tv_item3);
tr.addView(tv_item4);
Table.addView(tr, new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
Better you have a table row item in XML, inflate in as a new view and set data accordingly.
then add that view to the table layout
I am trying to add rows to a table after a click to a button (so after the generation of the activity).
My XML code is:
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="0,1"
android:id="#+id/result_table">
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
style="#style/MyHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Col1" />
<TextView
style="#style/MyHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Col2" />
</TableRow>
</TableLayout>
So when I load the activity I have my table with my only row. Then when I click on my button I do:
resultTable = (TableLayout)findViewById(R.id.result_table);
LayoutParams rowLayoutParams = new TableRow.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
LayoutParams cellLayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
TableRow tableRow;
TextView cellValue;
for(Asdf a : as) {
tableRow = new TableRow(this);
tableRow.setLayoutParams(rowLayoutParams);
cellValue = new TextView(this);
cellValue.setText(a.getText());
cellValue.setLayoutParams(cellLayoutParams);
cellValue.setTextAppearance(this, R.style.MyText);
tableRow.addView(cellValue);
cellValue = new TextView(this);
cellValue.setText("asdf");
cellValue.setLayoutParams(cellLayoutParams);
cellValue.setTextAppearance(this, R.style.MyText);
tableRow.addView(cellValue);
resultTable.addView(tableRow);
}
resultTable.invalidate();
But it doesn't add anything, and I am sure about that the loop iterates. I don't get any warning/exception in the logcat.
Can you help me please ??
Try to change the LayoutParams for the added Views like this:
TableLayout.LayoutParams rowLayoutParams = new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT, TableLayout.LayoutParams.WRAP_CONTENT);
TableRow.LayoutParams cellLayoutParams = TableRow.new LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT);
I have these three lists with the same number of elements
List<String>competitoinsIDs = new LinkedList<String>();
List<String>marks = new LinkedList<String>();
List<String>numOfQuestions = new LinkedList<String>();
I want to put the first element of each list in a tablerow , then the second element of each list in another tablerow, would you help me please, this is the xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
android:id="#+id/tlMarksTable"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableRow
android:id="#+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dip"
android:weightSum="2" >
<TextView
android:id="#+id/tvMarksCompetitionID"
android:layout_weight="1"
android:text="Competition"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/tvMarksMarks"
android:layout_weight="1"
android:text="Marks"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/tvMarksQuestionsNum"
android:layout_weight="1"
android:text="Questions"
android:textAppearance="?android:attr/textAppearanceMedium" />
</TableRow>
</TableLayout>
</FrameLayout>
First change your XML file to:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
android:id="#+id/tlMarksTable"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</TableLayout>
</FrameLayout>
We'll add all the content dynamically.
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
List<String>competitoinsIDs = new LinkedList<String>();
List<String>marks = new LinkedList<String>();
List<String>numOfQuestions = new LinkedList<String>();
//make sure that the lists contain data or else display will be blank screen
TableRow.LayoutParams params1=new TableRow.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT,1.0f);
TableRow.LayoutParams params2=new TableRow.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT);
TableLayout tbl=(TableLayout) findViewById(R.id.tlMarksTable);
for(int ctr=0;ctr<marks.size();ctr++)
{
//Creating new tablerows and textviews
TableRow row=new TableRow(this);
TextView txt1=new TextView(this);
TextView txt2=new TextView(this);
TextView txt3=new TextView(this);
//setting the text
txt1.setText(competitoinsIDs.get(ctr));
txt2.setText(marks.get(ctr));
txt3.setText(numOfQuestions.get(ctr));
txt1.setLayoutParams(params1);
txt2.setLayoutParams(params1);
txt3.setLayoutParams(params1);
//the textviews have to be added to the row created
row.addView(txt1);
row.addView(txt2);
row.addView(txt3);
row.setLayoutParams(params2);
tbl.addView(row);
}
}
please see the android code here and use it in your activities onCreate method
setContentView(R.layout.table_layout_xml); // use your layout xml file here
TableLayout tableLayout = (TableLayout)findViewById(R.id.tlMarksTable);
List<String>competitoinsIDs = new LinkedList<String>();
List<String>marks = new LinkedList<String>();
List<String>numOfQuestions = new LinkedList<String>();
// adding static values to test the layout. use your dynamic data here
competitoinsIDs.add("123");
competitoinsIDs.add("124");
competitoinsIDs.add("125");
marks.add("56");
marks.add("57");
marks.add("58");
numOfQuestions.add("10");
numOfQuestions.add("11");
numOfQuestions.add("12");
TableRow tableRows[] = new TableRow[competitoinsIDs.size()];
for (int i = 0; i < tableRows.length; i++) {
tableRows[i] = new TableRow(this);
tableRows[i].setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
tableRows[i].setWeightSum(2.0f);
tableRows[i].setPadding(5, 5, 5, 5);
TextView text = new TextView(this);
text.setLayoutParams(new android.widget.TableRow.LayoutParams(android.widget.TableRow.LayoutParams.WRAP_CONTENT,
android.widget.TableRow.LayoutParams.WRAP_CONTENT, 1.0f));
text.setText(competitoinsIDs.get(i));
tableRows[i].addView(text);
text = new TextView(this);
text.setLayoutParams(new android.widget.TableRow.LayoutParams(android.widget.TableRow.LayoutParams.WRAP_CONTENT,
android.widget.TableRow.LayoutParams.WRAP_CONTENT, 1.0f));
text.setText(marks.get(i));
tableRows[i].addView(text);
text = new TextView(this);
text.setLayoutParams(new android.widget.TableRow.LayoutParams(android.widget.TableRow.LayoutParams.WRAP_CONTENT,
android.widget.TableRow.LayoutParams.WRAP_CONTENT, 1.0f));
text.setText(numOfQuestions.get(i));
tableRows[i].addView(text);
tableLayout.addView(tableRows[i]);
}
I'm using eclipse + android SDK.
I'm trying to create a table with data provided by sensors. I get the information correctly, by i'm having problems to make a table to show it in XML dinamically.
This is the sensorinfo.XML:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1"
android:id="#+id/SensorInfoTableLayout">
<TableRow>
<TextView
android:layout_column="1"
android:text="#string/sensor_name_title"
android:padding="3dip" />
<TextView
android:layout_column="2"
android:text="#string/sensor_type_title"
android:padding="3dip" />
<TextView
android:layout_column="3"
android:text="#string/sensor_value_title"
android:padding="3dip" />
<TextView
android:layout_column="4"
android:text="#string/sensor_unit_title"
android:padding="3dip" />
</TableRow>
<View
android:layout_height="4dip"
android:background="#FF909090" />
</TableLayout>
And this is the code of my activity:
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
getSensorInfo();
setContentView(R.layout.sensorinfo);
setInfoByView();
}
And
private void setInfoByView()
{
/* Find Tablelayout defined in xml */
TableLayout myTableLayout = (TableLayout)findViewById(R.id.SensorInfoTableLayout);
/* Create a new row to be added. */
TableRow myTableRow = new TableRow(this);
myTableRow.setLayoutParams(new LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
/* Create a Button to be the row-content. */
Button b = new Button(this);
b.setText("Dynamic Button");
b.setLayoutParams(new LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
myTableRow.setBackgroundColor(5);
/* Add Button to row. */
myTableRow.addView(b);
/* Add row to TableLayout. */
myTableLayout.addView(myTableRow,new TableLayout.LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
}
THIS IS A TEST, i'm trying to include a button dinamically, if work, i will put the information i get from getSensorInfo();
But my Activity looks like this:
What could I be doing wrong?
All the info i found was THIS, but the answers didn't help me.
First of all create one Table Layout in your XML file like this :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#BFD6E8">
<ScrollView android:id="#+id/image_scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableLayout android:id="#+id/image_table"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</TableLayout>
</ScrollView>
</LinearLayout>
Then use this code for creating dynamic row inside the Table Layout :
TableLayout image_table=null;
image_table=(TableLayout)findViewById(R.id.image_table);
for(int i=0; i<10; i++){
TableRow tableRow=new TableRow(this);
tableRow.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
tableRow.setGravity(Gravity.CENTER_HORIZONTAL);
tableRow.setPadding(5, 5, 5, 5);
for(int j=0; j<1; j++){
Button bttn=new Button(this);
bttn.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
bttn.setText(Hello);
tableRow.addView(image, 200, 200);
}
image_table.addView(tableRow);
}
FINAL (test) SOLUTION:
private void setInfoByView2()
{
TableLayout myTableLayout = null;
TableRow myTableRow = new TableRow(this);
myTableLayout = (TableLayout)findViewById(R.id.SensorInfoTableLayout);
myTableRow.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
//myTableRow.setGravity(Gravity.CENTER_HORIZONTAL);
myTableRow.setPadding(5, 5, 5, 5);
Button bttn = new Button(this);
bttn.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
bttn.setText("Hello");
myTableRow.addView(bttn, 200, 200);
myTableLayout.addView(myTableRow);
}
And the button is visible now.
I'm trying to make my tablelayout which is nested in a relativeview scrollable.
Tried a couple of tutorials but nothing worked. Here is the xml and my java code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="#color/white" android:padding="10px"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="#+id/textView1"
android:paddingBottom="10dp" android:text="Mijn Rooster"
android:textSize="20sp" android:layout_alignParentTop="true"
android:layout_alignLeft="#+id/tablelayout"></TextView>
<ScrollView android:id="#+id/ScrollView01"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<TableLayout android:id="#+id/tablelayout"
android:layout_width=
"fill_parent" android:layout_height="wrap_content"
android:stretchColumns="0" android:layout_below="#+id/textView1"
android:layout_above="#+id/btnsearch">
</TableLayout>
</ScrollView>
<Button android:id="#+id/btnsearch" android:layout_width="wrap_content"
android:text="Zoek op Datum" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"></Button>
</RelativeLayout>
And here is the JAVA code:
TableLayout tl = (TableLayout) findViewById(R.id.tablelayout);
if (date_selected == null) {
for (int i = 0; i < roostermap.size(); i++) {
TableRow trdaydatetime = new TableRow(this);
TableRow trinfo = new TableRow(this);
trdaydatetime.setLayoutParams(new LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
TableRow.LayoutParams rowSpanLayout = new TableRow.LayoutParams(
TableRow.LayoutParams.FILL_PARENT,
TableRow.LayoutParams.WRAP_CONTENT);
rowSpanLayout.span = 3;
TextView txtDay = new TextView(this);
TextView txtTime = new TextView(this);
TextView txtResult = new TextView(this);
// Set Text
txtDay.setText(roostermap.get(i).getDay(
roostermap.get(i).getRoster_date().getDay(),
roostermap.get(i).getRoster_date())
+ " " + df.format(roostermap.get(i).getRoster_date()));
txtTime.setText(dft.format(roostermap.get(i).getRoster_start())
+ " - " + dft.format(roostermap.get(i).getRoster_end()));
txtResult.setText(roostermap.get(i).getWorkplace_name());
// Day&Date Layout
txtDay.setLayoutParams(new LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
txtDay.setPadding(5, 5, 0, 0);
txtDay.setTextColor(Color.BLACK);
// Text Time layout
txtTime.setLayoutParams(new LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
txtTime.setTextColor(Color.BLACK);
txtTime.setPadding(0, 5, 10, 0);
txtTime.setGravity(Gravity.RIGHT);
// Text Result layout
txtResult.setLayoutParams(new LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
txtResult.setPadding(5, 0, 0, 5);
trdaydatetime.addView(txtDay);
trdaydatetime.setBackgroundResource(R.drawable.trup);
trdaydatetime.addView(txtTime);
trinfo.addView(txtResult, rowSpanLayout);
trinfo.setBackgroundResource(R.drawable.trdown);
tl.addView(trdaydatetime, new TableLayout.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
tl.addView(trinfo, new TableLayout.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
}
In order for the 'scrolling' to work you need the content of the ScrollView to be larger than the ScrollView itself. Since you have set the android:layout_height value to wrap_content, the height of the ScrollView matches the height of its content - which means no scrolling.
Fix the android:layout_height value of the ScrollView by either setting it to fill_parent (possibly with android:layout_weight) or a pixel value.
Eliminate the ScrollView. You cannot combine two Views which are both scrollable, especially if the scroll in the same direction.
A TableView itself handles scrolling if the content is larger then the height of the TableView.