开发者

Increasing the size if UIButton by pinching in iphone

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜