UIDeviceOrientationPortrait,ios 6&;7、界面定向
我有这个代码,我想转到另一个uiview,但我想只在纵向模式下显示这个视图(第二个视图),第一个视图中的通知在第二个视图中不起作用 有什么办法可以改变这一点吗UIDeviceOrientationPortrait,ios 6&;7、界面定向,ios,ios6,ios7,uiinterfaceorientation,uideviceorientation,Ios,Ios6,Ios7,Uiinterfaceorientation,Uideviceorientation,我有这个代码,我想转到另一个uiview,但我想只在纵向模式下显示这个视图(第二个视图),第一个视图中的通知在第二个视图中不起作用 有什么办法可以改变这一点吗 [[NSNotificationCenter defaultCenter] removeObserver:self]; view2 *viewController = [[[view2 alloc] init] autorelease]; UINavigationController *navController
[[NSNotificationCenter defaultCenter] removeObserver:self];
view2 *viewController = [[[view2 alloc] init] autorelease];
UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:viewController] autorelease];
viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:navController animated:NO];
我想要一个完全相同的函数,这段代码在ios>6中
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return NO;
}
尝试子类化UINavigationController并重写以下方法:
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
真奇怪!您是否创建了新自定义导航控制器的实例,如下所示:UINavigationController*navController=[[[CustomNavigationController alloc]initWithRootViewController:viewController]autorelease];是的,但是我怎样才能用代码转到其他导航控制器