开发者

Increasing the size if UIButton by pinching in iphone

开发者 https://www.devze.com 2023-04-12 02:34 出处:网络
I have a UI开发者_C百科Button & want to increase the size of UIButton by pinching the UIButton.Is it possible with UIButton similarly to UIImageView.Yes it is. Just get the gesture and then scale

I have a UI开发者_C百科Button & want to increase the size of UIButton by pinching the UIButton.Is it possible with UIButton similarly to UIImageView.


Yes it is. Just get the gesture and then scale your button accordingly.


Here you have nice tutorial with gesture recognizers. For pinching use UIPinchGestureRecognizer after hooking it up you can retrieve scale of pinching easily. In your case don't use affine transform to scale, because it will cause blurring of the button. Instead, you should calculate frame of button by hand. This is more complicated, but result should be exactly what you want.

0

精彩评论

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

关注公众号