Best way to accomplish something like subcells with an UITableView on iPad?
I have a table view where I show chapter title's of a book.
When I touch a cell, I check if there is more than on开发者_StackOverflowe file to open because some of this chapters have different versions. So I need something like a subcell which moves in, or a popover where I can choose a version to open. In my opinion the popover only looks good when you press a button from the navigation bar. I don't want to open another table view, it should be on the same view. What could be the easiest and fastest solution? It's an iPad app.Greets Max
You can create another viewController for multiple chapters. This should contain a tableView that you load with the chapter options. Then use didselectrowatindexpath
to load the data for that viewController with the different chapter options for the selection. If you push the new viewController with a navigationController, then the user can easily navigate back.
However, the easiest thing to do would be to present something like a UIActionSheet
with the options (provided there aren't too many of them) or make a custom view similar to it and present that modally ( with presentModalViewController
).
精彩评论