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 回答