2012-08-17 76 views

回答

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; 

} 

享受:-)

+0

嘿它顯示DegreesToRadians – 2012-08-21 05:36:27

+0

不工作的人的錯誤。 – 2012-08-21 05:39:59

+0

查看更新的問題我已添加屏幕截圖 – 2012-08-21 05:41:15