开发者

How to display HTML-like table data on iPhone?

开发者 https://www.devze.com 2023-01-03 15:10 出处:网络
I have a set of data in a matrix which I would like to display in my iPhone app with all of the rows and columns intact. Everything I can find on the web dealing with \"tables iPhone\" gives me inform

I have a set of data in a matrix which I would like to display in my iPhone app with all of the rows and columns intact. Everything I can find on the web dealing with "tables iPhone" gives me information on UITableView, which only lets you show a list of items to the use开发者_如何学Cr - not an actual table in the HTML sense. What's the best way on the iPhone to display an actual table of data to the user, with column & row headings and table cells?


The solution that I found was simply to use a UIWebView. Then I can build the HTML table dynamically and load it into the web view.


The UITableView class was specifically designed to only show one column at a time due to the small size of the screen. If the data of your application absolutely needs to be laid out in one big grid on one screen the right way to do it, would be to add each cell as a subview to a custom view. Then implement the layoutSubviews method on your custom view to lay out the frames of the subviews in the grid you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号