Search code examples
iosaqgridview

AQGridView orientation change has no effect


I'm fairly new to ios programming and am implementing AQGridView in a project I'm working on.

I've noticed the example applications provided seem to be able to handle orientation changes and regroup the cells accordingly.

In my application, the AQGridView appears in a UINavigationController stack. Any views prior to the one with the AQGridView handle orientation changes fine and adjust content based off the orientation.

However, once my app reaches the view with the AQGridView it seems to get stuck into portrait mode. Any change of the orientation does not seem to do anything and the AQGridView does not regroup the cells.

I've looked into the source code of the example apps and can't see any difference in implementation to my app.

Am I missing anything here? Is there anything special I need to do for AQGridView to support orientation changes and regroup the cells?


Solution

  • Turns out it was a problem with UITabBarController.

    If anyone is having the same problem as me, I'd suggest looking at all the root view controllers for the UITabBarController.

    Make sure the following method returns YES for all the view controllers or autorotation will not work.

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation