Reputation: 1
How to implement below image in Android.
In this view the time row should static, but table row are dynamic and each row the cell width is depend on time. Here green box are cells.
https://i.sstatic.net/bBtsJ.jpg
Upvotes: 0
Views: 77
Reputation: 29
If I understand correctly, you want to change the blue and green boxes dynamically and the rest is static. So you want to change the column span programmatically. To do this, first find the View you want to change using TextView tv = (TextView) findViewById(R.id.some_sensible_id);
and then call
TableRow.LayoutParams params = (TableRow.LayoutParams) tv.getLayoutParams();
params.span = columnsToSpan;
tv.setLayoutParams(params);
Where columnsToSpan is how many columns the View should occupy.
Upvotes: 1