1
votes

I have a Table View Controller (root) and 5 View Controllers in my project. The view Controllers turn only to landscape view (as I want) but not the Table View Controller (only in the Portrait view).In supported Device Orientations I deleted Portrait and Upside down, and I wrote in every class:

  • (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));

Any suggestions to make Table view turn only to landscape view?

1
I also have a UITableViewController and it never goes to portrait mode when I forbid it like you did with the shouldAutorotateToInterfaceOrientation function - Titouan de Bailleul
Actually, in the Simulator it turns to landscape view, but the rows of the TableViewController don't turn (stay in Portrait view)... - George
Have you changed frame of table in willRotate... method? - Mrunal
I haven't done any willRotate method, only the above: shouldAutorotate... - George

1 Answers

0
votes

put this in the viewDidLoad

self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;