[英]Increasing the size if UIButton by pinching in iphone
我有一个UIButton,想通过捏UIButton来增加UIButton的大小.UIButton是否有可能类似于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. 要进行捏合,将UIPinchGestureRecognizer
后,您可以轻松检索捏合的比例。 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. 这比较复杂,但是结果应该正是您想要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.