在PortraitUpsideDown中启动App会产生翻译问题

我的视图中有几张图片。在旋转时,我的图像通过CGAffineTransformTranslate& amp;旋转。 然而,当我在PortraitUpsidedown中启动时,我会定义一个翻译 “ - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {”method。 此翻译只需在使用设备进行方向更改时进行。如何确保在启动时不会发生此转换? 编辑: 在实施viewWillAppear方法的提示之后仍然遇到问题。 这是我项目的一些代码。
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {

    [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];

    if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
       toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {

        image1.transform = CGAffineTransformTranslate( image1.transform, -65.0, 255.0);
        image2.transform = CGAffineTransformTranslate( image2.transform, -65.0, 255.0);
    }
    else {

        image1.transform = CGAffineTransformIdentity;
        image2.transform = CGAffineTransformIdentity;
    }

}

-(void) viewWillAppear:(BOOL)isRotated{

    isRotated = FALSE;
}
但是我如何实现我定义的代码片段
isRotated = TRUE;
谢谢你的帮助 !     
已邀请:
使用
shouldAutorotateToInterfaceOrientation
委托方法:
 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Overriden to allow any orientation.
    return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}
设置
BOOL
变量。当接口是我们需要使用的接口时,将它设为
YES
&旋转,或从那里调用方法来翻译: 喜欢:
if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) 
    // do something
    

要回复问题请先登录注册