gpt4 book ai didi

iphone - ios 6.0 及更高版本中的方向问题

转载 作者:行者123 更新时间:2023-12-03 21:02:01 24 4
gpt4 key购买 nike

我正在开发一个应用程序,其中一个 UIViewController 中有许多 UIView。现在的问题是,所有 UIView 都处于横向模式,这里只有一个 UIView 处于纵向模式。我无法使用 shouldAutorotate 方法获得此特定输出。

任何人都可以建议我具体的方法来解决这个问题。

最佳答案

@pratik-bhiyani 谢谢...但我已经完成了这种代码,以在需要旋转 View 时获取特定代码

- (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;
}

关于iphone - ios 6.0 及更高版本中的方向问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16271573/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com