Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone ios 6.0及更高版本中的定向问题_Iphone_Ios6_Uiinterfaceorientation - Fatal编程技术网

Iphone ios 6.0及更高版本中的定向问题

Iphone ios 6.0及更高版本中的定向问题,iphone,ios6,uiinterfaceorientation,Iphone,Ios6,Uiinterfaceorientation,我正在开发一个应用程序,其中一个UIViewController中有多个UIView。现在的问题是,所有UIView都处于横向模式,这里只有一个UIView处于纵向模式。我无法使用shouldAutorotate方法获得此特定输出 有谁能给我建议缩短这一问题的具体方法。@pratik bhiyani谢谢。。。 但我已经完成了这类代码,以便在需要旋转视图时获得特定代码 - (IBAction)btnClickToRedeem:(id)sender { isPortraitRqurd = T

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

有谁能给我建议缩短这一问题的具体方法。

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

您是否更改了构建设置?是的,我已更改,但无法从横向设置纵向视图。返回是;在构建设置中(如图所示),同时按下UpsideDown按钮并使其变暗。aceept和upvote如果您觉得我的答案有用,祝您度过愉快的一天:)