2

I am working on an app where I have just assign the transformation to image view when device rotated in landscape mode. Now I want exact frame of that image view after transformation applied to it. I have tried with this example: Find Frame Coordinates After UIView Transform is Applied (CGAffineTransform) but not succeeded. Code I have used:

UIView *Newview = [[UIView alloc] initWithFrame:_FullImageView.frame];
_FullImageView.transform=CGAffineTransformMakeRotation(-M_PI_2);

_FullImageView.frame = CGRectMake(Newview.frame.origin.x, Newview.frame.origin.y,Newview.frame.size.width,Newview.frame.size.height);

_FullImageView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin |  UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;

If anybody have any suggestion then please let me know. It would be very appreciated. Thanks.

Arasuvel
  • 2,971
  • 1
  • 25
  • 40
Vishal
  • 8,246
  • 6
  • 37
  • 52

1 Answers1

0

Please check the following code. Hope you need the same.

UIView*Newview = [[UIView alloc] initWithFrame:_FullImageView.frame];

_FullImageView.transform=CGAffineTransformMakeRotation(-M_PI_2);

CGRect rect = _FullImageView.frame;

Check rect frame , it gives you the frame after transform.

Myaaoonn
  • 1,001
  • 12
  • 25
  • This code always return (CGRect) rect = (origin = (x = -67.5, y = 67.5), size = (width = 455, height = 320)) but when I transform the image view then image display according to ratio and fit in image view accordingly I need that image view image frame after rotation. Thanks. – Vishal Aug 10 '17 at 06:36