How do you display a spreadsheet-like table in an

2019-08-03 19:04发布

问题:

I need to display a spreadsheet in a view. There's no need to edit the cells of the spreadsheet, and the spreadsheet will consistently have the same number of rows and columns. (The spreadsheet cells will be populated with financial figures generated by the user in a different view)

How would I do this? A UITableView seems inadequate, as there need to be around 70-80 cells displayed in this table.

回答1:

One way to do it is to write your own table cell to contain all the columns in a particular row. Then you can load the cell for each row in UITableView



回答2:

If the cells don't need to be editable, they don't contain images, and the number of cells isn't large, you could just use labels or drawn text inside a grid of framed rectangles in a UIView, and display that larger view inside a UIScrollView.