简体   繁体   中英

Scaling a UIView with UIPanGestureRecognizer

I have a rectangle UIView with a UIWebView as a subview, and I want to change the scale when pan is detected on the upper left corner. I already have another small UIView in the upper left corner so the scaling should start from there. I know this can be done by UIPinchGestureRecognizer but having a UIWebView there will be an obstacle for that. I've added a UIPanGestureRecognizer to the main UIView so it's movable. but I want to check if the pan is from the small UIView in the upper left corner and from there change the scale transform of the UIView. So how to do that? Also is it possible to change the scale horizontally/vertically depending on the direction I'm panning the small UIView to? Also is it possible to set a minimum/maximum scale so the UIView won't scale after that?

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM