简体   繁体   English

如果通过在iPhone中捏UIButton来增加尺寸

[英]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.

相关问题 暂时在触摸时增加UIButton的大小 - Increasing UIButton size temporarily on touch 在iPhone的屏幕大小上更改UIButton的大小 - Change the size of an UIButton on screen size of iPhone 修改在IB中创建的UIButton在iPhone 5上大小不正确 - Modifying UIButton created in IB not correct size on iPhone 5 iPhone:在UItabbarcontroller中增加视框的大小吗? - iPhone: increasing size of view frame in a UItabbarcontroller? 缩小/缩小后,UIScrollview中的UIButton的移动变慢 - Movement of UIButton which is in the UIScrollview becomes slow after pinching/zooming out 对于来自iPhone中Web服务的内容,增加单元格的大小 - Increasing the size of the cell of with respect to the content coming from webservice in iphone 捏时检查UIImageView的大小是否小于原始大小 - check size of UIImageView is smaller than original when pinching 如何在iphone 5s和iphone X的故事板中为uibutton设置不同的大小? - How to set different size for uibutton in storyboard for iphone 5s and iphone X? 根据 iPhone 大小的特定类型自动布局 UIButton 和 UILabel 字体大小[非编程] - Autolayout UIButton and UILabel font size according to specific type of the iPhone size[NOT PROGRAMMATICALLY] iPhone中的UIButton事件 - UIButton Event in iphone
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM