iphone - UIButton 类似闪烁

标签 iphone

你好 friend 如何使 uibutton 像眨眼一样我使用了下面的代码,但它不像眨眼 在我的应用程序中,我开发了录音功能,所以我想喜欢那个按钮

CABasicAnimation *pulseAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
pulseAnimation.duration = .5;
pulseAnimation.toValue = [NSNumber numberWithFloat:1.1];
pulseAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
pulseAnimation.autoreverses = YES;
pulseAnimation.repeatCount = FLT_MAX;
[btnBlink.layer addAnimation:pulseAnimation forKey:nil];

最佳答案

或者您可以通过调用定义的方法使用 NSTimeInterval 连续增加或减少按钮 alpha

关于iphone - UIButton 类似闪烁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11538712/

相关文章:

iphone - 使用XCode进行调试时,应用可以正常运行,在设备或模拟器上运行时,应用会崩溃

iphone - 在 iPhone 中将句子的每个单词的第一个字母转换为大写

iphone - iOS6以来按钮背景和渐变的变化

iphone - Mapkit 路线和 google 许可证

iphone - 使用核心图时应用程序崩溃

iphone - 动画移动和旋转 UIView 不太有效

iphone - 比较 NSDates

iphone - Cocos2d-iphone 对 iPhone 4 高分辨率的支持

iphone - 如何开始构建 iPhone 语音聊天应用程序?

iphone - iOS 为 UIImageView 获取图像的可见部分