3
A
回答
3
UIView
实例应具有动画效果,可使用[UIView animateWithDuration:animations:]
。由于UIButton
是UIView
一个子类,我不预见任何问题......
3
前面已经说过UIButton
实例应该是动画作为其UIView
一个子类。下面的代码会将您的UIButton
前后移动,即左右20个像素10次。基本上我是一起链接2个动画。
- (void)startLeftRightAnimation
{
[UIView animateWithDuration:0.5
delay:0
options:UIViewAnimationOptionCurveEaseIn
animations:^(void)
{
[self.button setFrame:CGRectMake(self.logo.frame.origin.x-20,self.logo.frame.origin.y,self.logo.frame.size.width,self.logo.frame.size.height)];
}
completion:^(BOOL finished)
{
if(finished)
{
[UIView animateWithDuration:0.5
delay:0
options:UIViewAnimationOptionCurveEaseIn
animations:^(void)
{
[self.button setFrame:CGRectMake(self.logo.frame.origin.x+40,self.logo.frame.origin.y,self.logo.frame.size.width,self.logo.frame.size.height)];
[self startLeftRightAnimation];
}
completion:^(BOOL finished)
{
if(finished)
{
}
}];
}
相关问题
- 1. uibutton动画
- 2. UIbutton flashing动画
- 3. UIButton的动画
- 4. UIButton移动动画
- 5. 动画选择UIButton
- 6. UIButton周转动画
- 7. UIButton动画视图
- 8. 动画UIButton图层?
- 9. UIButton图像动画
- 10. UIButton上的动画
- 11. 在动画视图时动画UIButton
- 12. animateWithDuration不是动画UIButton
- 13. 动画UIButton文本颜色
- 14. 的UIButton动画扩展
- 15. 在UIButton中实现动画
- 16. UIButton与UIButtonTypeCustom动画错误
- 17. 动画UIButton边框厚度
- 18. 动画UIButton背景图像
- 19. iPhone UIButton自定义动画
- 20. 将动画分配给UIButton
- 21. 添加选择动画到一个UIButton
- 22. 动画停止后删除UIButton
- 23. UIButton AppStore购买按钮动画
- 24. UIButton动画无法正常工作
- 25. UIButton的翻转动画在循环
- 26. 在动画中间禁用UIButton
- 27. 动画UIButton放大和缩小点击
- 28. UIButton上的动画点击iPhone
- 29. UIModalTransitionStylePartialCurl导致UIButton文字动画
- 30. 动画时UIButton没有响应