andreamazz / SlideOutNavigation

SlideOut Navigation Controller for iOS.
MIT License
210 stars 49 forks source link

Landscape mode doesn't work in iOS 5.1 #42

Closed FredzL closed 10 years ago

FredzL commented 10 years ago

I added this method in AMSlideOutNavigationController.m to make it work :

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return YES;
}
andreamazz commented 10 years ago

You need to set up your app supported orientation in your project main settings, shouldAutorotateToInterfaceOrientation is no longer used. You can check the sample included in this repository, the controller successfully rotates.

FredzL commented 10 years ago

Ah sorry I didn't mention that it was for iOS 5.1, does the sample work in this case as well ?

andreamazz commented 10 years ago

You're right, this won't work in iOS5, I forgot that the library still supports that. I'll reintroduce the shouldAutorotateToInterfaceOrientation tomorrow with the fix for the other issue that you opened.

FredzL commented 10 years ago

Thanks.

There was also a problem with the bounds when going in landscape mode, an empty bar of 20 pixels appeared at the top and was still there when back in portrait mode (maybe related to issue #39). I had to call [[self view] setFrame:[[UIScreen mainScreen] bounds]]; in viewWillAppear and viewDidLayoutSubviews in AMSlideOutNavigationController.m.

Not sure if it's the cleanest way to do it though...

FredzL commented 10 years ago

While we are at it, I had to replace indexPathForItem by indexPathForRow twice in the method switchToControllerTagged in AMSlideOutNavigationController.m to make it work in iOS 5.1. Sorry for not providing pull requests, I've not yet set up Git on this machine...

andreamazz commented 10 years ago

Commit 38a981d enables the rotation in iOS5, also fixes the menu scrolling lock from being enabled/disabled incorrectly upon rotation.

As for the orientation's problems in iOS5: I tested it on a iOS 5 device and found no issues. Can you list here the steps to reproduce the bug? Your fix (setting the view's frame as the screen bounds) seems to 'eat' 20 pixels from the menu's TableView on iOS5 & 6, while it has no effects in iOS7.

FredzL commented 10 years ago

Sorry but I don't work on this project anymore (finished), if I come back to it I will report back. Without the modifications there was a 20 pixel gap at the top of the screen when going into landscape mode that was still present when going back to portrait. Maybe one of your other commits corrected the problem.