0

向きが変わったときに私がすることは次のとおりです...

-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    if((self.interfaceOrientation == UIDeviceOrientationPortrait) || (self.interfaceOrientation == UIDeviceOrientationPortraitUpsideDown))
    {    
        [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"auto_main_hor.png"]]];
        [UIView commitAnimations];

    } else if((self.interfaceOrientation == UIDeviceOrientationLandscapeLeft) || (self.interfaceOrientation == UIDeviceOrientationLandscapeRight))
    {
        [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"auto_main_vert.png"]]];
    } 
}

デバイスを急激に 180 度回転させると、誤って表示されますか? どうすれば修正できますか?

4

1 に答える 1

1

UIInterfaceOrientationUIDeviceOrientationは同じものではありませんのでご注意ください。インターフェイスの向きを使用する必要があるデバイスの向きを使用しています。

于 2011-10-28T01:56:28.107 に答える