1
我正在开发一个应用程序,其中有一个UIViews在一个UIViewController中。现在的问题是它具有所有UIViews在横向模式下,这里只有一个UIView是纵向的。我无法使用shouldAutorotate方法获得此特定输出。ios 6.0及更高版本中的Orientatin问题
有人可以建议我具体的方法来解决这个问题。
我正在开发一个应用程序,其中有一个UIViews在一个UIViewController中。现在的问题是它具有所有UIViews在横向模式下,这里只有一个UIView是纵向的。我无法使用shouldAutorotate方法获得此特定输出。ios 6.0及更高版本中的Orientatin问题
有人可以建议我具体的方法来解决这个问题。
@ PRATIK-bhiyani谢谢... 但我已经做了这样的代码来获取特定的代码时,我需要旋转我的看法
- (IBAction)btnClickToRedeem:(id)sender
{
isPortraitRqurd = TRUE;
[self shouldAutorotate];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
if(isPortraitRqurd)
return (toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
else
return (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight || toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
if(isPortraitRqurd)
return UIInterfaceOrientationMaskPortrait;
else
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
if(isPortraitRqurd)
{
return UIInterfaceOrientationPortrait;
isPortraitRqurd = FALSE;
}
else
return UIInterfaceOrientationLandscapeRight;
}
你取得了构建环境的变化? – 2013-04-29 05:25:17
是的,我做了它,然后也不能从景观设置肖像视图。 – 2013-04-29 05:35:20
返回YES;并在构建设置中(如图所示),并按下UpsideDown按钮并使其变暗。 – 2013-04-29 05:38:07