transformed/rotation 在横向模式下应用后获取图像视图精确帧
get image view exact frame after transformed/rotation apply in landscape mode
我正在开发一个应用程序,当设备在横向模式下旋转时,我刚刚将转换分配给图像视图。现在我想要应用变换后该图像视图的精确框架。我试过这个例子:Find Frame Coordinates After UIView Transform is Applied (CGAffineTransform) 但没有成功。我用过的代码:
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;
如果有人有任何建议,请告诉我。我们将不胜感激。谢谢。
请检查以下代码。希望你需要同样的。
UIView*Newview = [[UIView alloc] initWithFrame:_FullImageView.frame];
_FullImageView.transform=CGAffineTransformMakeRotation(-M_PI_2);
CGRect rect = _FullImageView.frame;
检查矩形框架,它给你变换后的框架。
我正在开发一个应用程序,当设备在横向模式下旋转时,我刚刚将转换分配给图像视图。现在我想要应用变换后该图像视图的精确框架。我试过这个例子:Find Frame Coordinates After UIView Transform is Applied (CGAffineTransform) 但没有成功。我用过的代码:
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;
如果有人有任何建议,请告诉我。我们将不胜感激。谢谢。
请检查以下代码。希望你需要同样的。
UIView*Newview = [[UIView alloc] initWithFrame:_FullImageView.frame];
_FullImageView.transform=CGAffineTransformMakeRotation(-M_PI_2);
CGRect rect = _FullImageView.frame;
检查矩形框架,它给你变换后的框架。