3
votes

I rotate my tableView by using tableView.transformation to use a portrait tableView in landscape mode, but since I've been doing this, my TableView bounces vertically and horizontally. By default, a tableView only bounces vertically; so I thought that after rotating it, I would get only a horizontal bounce, but its bounces both horizontally and vertically.

Does anyone know how to fix this? Maybe it has something to do with the contentView of the tableView (UITableView inherits from UIScrollView). I've tried to set the contentView but it doesn't work.

1

1 Answers

0
votes

The simplest implementation

UITableView *tv = [[UITableView alloc] initWithFrame:CGRectMake(10.f, 10.f, 300.f, 300.f) style:UITableViewStylePlain];
tv.transform = CGAffineTransformMakeRotation(1.5707);
[self.view addSubview:tv];

works as expected. The table only bounces vertically (which is horizontal on the screen). If you're creating the table in IB, make sure Bounces and Bounce Vertically are selected, but Bounce Horizontally is not.