开发者

How can I make a UIView that is stretchable by its corners?

开发者 https://www.devze.com 2023-02-01 20:38 出处:网络
I\'d like to have a UIView where the user can select each of t开发者_开发技巧he four corners and stretch the view by independently moving them.

I'd like to have a UIView where the user can select each of t开发者_开发技巧he four corners and stretch the view by independently moving them.

How would I implement such a view?


To do this, you will need to subclass UIView and handle touch events manually. When you get a touch event, you will have to do some math and then set the frame of the view to the new size. I'd recommend making the background image a stretchable image using stretchableImageWithLeftCap:topCap. It shouldn't actually be that hard.

0

精彩评论

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

关注公众号