I’d like to have a UITableView with cells wider than 320 points. The user should be able to scroll sideways to be able to view different parts of a UITableViewCell. Is this kind of behavior possible with a UITableView, or should I go and try to implement a tiling UIScrollView?
I tried wrapping a UITableView within a UIScrollView, and the results are terrible – they compete for the scroll gestures and most of the time the scroll view wins, preventing the table from being traversed vertically.
Any input is appreciated!
Thank you!
Update: I tried the proposed solution and it scrolls properly, but the tableview is still only 320 pixels wide. Is tableView’s width linked to the window bounds ?
Wrapping the table view with the scroll view is the right way.
UIScrollView with
Inside that, a UITableView
Then I set the table view’s frame, with
w,being the calculated width of the table view with all columns, whatever your width, andkTableScrollViewHeightbeing the fixed height of both the table view and the scroll view, in my case, for example 367 points (screen minus status, navbar and tabbar):and the scroll view’s content size
If you want the scroll-to-top behavior when the user taps the status bar, you might want to set
because otherwise the scroll view will take away the tap from the table view.