0

I have a UIImageView in bottom side of UIWindow. I want it to always display it in bottom side whatever the orientation is, but having trouble implementing it. Any Solution for this ?

enter image description here

Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256

1 Answers1

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;

}

Enjoy :-)

Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256
Jayendra
  • 73
  • 1
  • 8