【发布时间】:2010-08-05 09:45:26
【问题描述】:
我有一个关于帧大小的动画,当 UIButton 是 UIButtonTypeRoundedRect 时效果很好。但是当我使用带有背景图像的 UIButtonStyleCustom 时没有明显的影响。我的动画代码在这里:
[UIView beginAnimations:@"MyAnimation" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.25];
CGRect tempFrame = myButton.frame;
tempFrame.size.width = tempFrame.size.width + 100.0f;
myButton.frame = tempFrame;
[UIView commitAnimations];
感谢您的帮助!
【问题讨论】:
-
也许
[UIView beginAnimations:nil context:@"MyAnimation"];真的是[UIView beginAnimations:@"MyAnimation" context:NULL];(第一个参数是animationID,NSString *;第二个-context,void *)? -
@kpower 很抱歉打错了字,但还是不行。
-
“不工作”是什么意思?具体一点。
标签: iphone objective-c cocoa-touch uikit core-animation