0

UIWindow の下側に UIImageView があります。向きが何であれ、常に下側に表示したいのですが、実装に問題があります。これに対する解決策はありますか?

ここに画像の説明を入力

4

1 に答える 1

0
NSLog(@"rotate");

if (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation)){
    AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate; 

    // Rotate 90 degrees to hide it off screen
    CGAffineTransform rotationTransform = CGAffineTransformIdentity;
    rotationTransform = CGAffineTransformRotate(rotationTransform,DegreesToRadians(0));
    delegate.imgV.transform = rotationTransform;

}
else if (UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation)){
    AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate; 

    // Rotate 90 degrees to hide it off screen
    CGAffineTransform rotationTransform = CGAffineTransformIdentity;
    rotationTransform = CGAffineTransformRotate(rotationTransform,DegreesToRadians(90));
    delegate.imgV.transform = rotationTransform;

}

楽しみ :-)

于 2012-08-20T12:36:23.457 に答える