在push出的viewcontroller里面 下面方法不会被执行
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}
This is what I did before:
Add categories of UITabBarController and UINavigationController
UITabBarController (xxx)
UINavigationController (xxx)
The callback of UINavigationController is valid, only one callback of viewcontroller is necessary, forget that one. You write both. In fact, your top-level viewcontroller also needs to be controlled.
Could you please tell me what the correct approach is? I did the above but it still doesn’t work?