- Forum posts: 10
Mar 20, 2021, 2:46:05 PM via Website
Mar 20, 2021 2:46:05 PM via Website
I am creating dynamic TableView which includes 3 columns and rows as per my input value entered. The value will display on the first column as per the input entered.
My table row will be updated like
0
20
40
60
80
100
Etc...
My code is
stk.addView(tbrow0);
for (int i = 0; i < input1 / input2 + 1; i++) {
TableRow tbrow = new TableRow(this);
TextView t1v = new TextView(this);
t1v.setText("" + i * input2);
t1v.setTextColor(Color.BLACK);
t1v.setGravity(Gravity.CENTER);
t1v.setTextSize(12);
t1v.setBackgroundResource(R.drawable.border);
tbrow.addView(t1v);
I want to display the values in descending order (High to low) in the first column.
100
80
60
40
20
0
I don't know how to modify my code. Pls guide me