Anupam Tripathi
Anupam Tripathi

Reputation: 1

How to implement this table view in android

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

Answers (1)

DrRobot
DrRobot

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

Related Questions