Tag: 面向对象

iOS强制景观在一个viewController

先生, 我正在使用mapview模块,其中风景是唯一的方向允许,但其他只有肖像。 当在设备上运行ios 7和8时,视图控制器仍然呈现为纵向,除非我必须手动将设备转为横向。 你能告诉我还有什么其他的步骤吗? 以下是我的代码 AppDelegate.h @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (nonatomic) BOOL isTaskPoint; @end AppDelegate.m – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) return YES; return NO; } PreviousController.m MapViewController * sliderVC = [[MapViewController alloc] init ]; AppDelegate *appDelegate = (AppDelegate *) [UIApplication sharedApplication].delegate; appDelegate.isTaskPoint = TRUE; sliderVC.modalPresentationStyle = UIModalPresentationCurrentContext; […]