iphone - UIButton 触摸时缩放?

标签 iphone ipad animation uibutton scale

有人可以告诉我如何在触摸时缩放 UIButton 吗?该按钮应放大 10% 左右。

提前致谢!

最佳答案

通话

button.transform = CGAffineTransformMakeScale(1.1,1.1);

在按钮按下处理程序中。

或者如果您想使用动画进行缩放:

[UIView beginAnimations:@"ScaleButton" context:NULL];
[UIView setAnimationDuration: 0.5f];
button.transform = CGAffineTransformMakeScale(1.1,1.1);
[UIView commitAnimations];

关于iphone - UIButton 触摸时缩放?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3670799/

相关文章:

iphone - 如何使用 iPhone SDK 从 SQLite 数据库中获取原始特殊字符?

javascript - jQuery animate() 仅适用于第二次点击

Android 动画 - 翻转

iphone - 某些 iPhone 4s 和 iPod Touch 上的随机 img 保存错误

iphone - 通过AVAudioRecorder录制声音

JavaScript 浏览器代理重定向

iphone - 如何使 UIView 的 subview 居中

iphone - ABPersonViewController 在选择照片时导致 iPad 上的 UIViewControllerHierarchyInconsistency

ios - iPad Retina 启动图像——仅显示图像的上半部分

ios - 第二次触摸动画