我有一个风险投资在肖像,这提出了另一个风险投资,可以是肖像或风景。问题是,当我回到展示它的原始VC时,它也是以横向显示的,直到我旋转它,然后它停留在纵向。我想要的是始终保持原始VC始终是纵向的,我如何才能实现这一点?这是在我的PList中设置了支持的方向之后,我用来设置VC方向的代码:
在最初的VC中,这应该始终是纵向的
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (BOOL)shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}在我的风险投资中,可以是肖像也可以是风景,我有:
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}发布于 2014-05-18 22:41:43
重写supportedInterfaceOrientations方法并返回UIInterfaceOrientationMaskPortraitUpsideDown。
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortraitUpsideDown;
}https://stackoverflow.com/questions/23723092
复制相似问题