开发者

Scale UIImageView in UIScrollView while rotating with UIRotationGestureRecognizer

开发者 https://www.devze.com 2023-04-02 16:19 出处:网络
I have an UIImageView in an UIScrollView. I want the UIImageVie开发者_如何学JAVAw to be zoomable and rotatable.

I have an UIImageView in an UIScrollView. I want the UIImageVie开发者_如何学JAVAw to be zoomable and rotatable. Right now, zooming works fine.

Now I want use UIRotationGestureRecognizer to add rotation. The problem is, that when I rotate the UIImageView, I also need to zoom it with a factor depending on the rotation angle to make sure the UIScrollView is always completely filled by the image.

I need the math to calculate this factor. Anyone know how to do it?

Thanks in advance!

0

精彩评论

暂无评论...
验证码 换一张
取 消