【发布时间】:2012-07-12 05:07:56
【问题描述】:
我正在尝试通过在视图加载后来回更改 alpha 级别来使其中包含图像的 uibutton 缓慢脉动...
目前我正在这样做,但它什么也没做......
-(void)loopdyloop
{
while ( myCount < 1000 )
{
[UIView animateWithDuration:3.0
delay:0.0f
options:UIViewAnimationCurveEaseOut
animations:^{
iconButton.alpha = 0.0;
} completion:^(BOOL finished) {
if (finished) {
NSLog(@"animated");
}
}];
[UIView animateWithDuration:3.0
delay:0.0f
options:UIViewAnimationCurveEaseOut
animations:^{
iconButton.alpha = 1.0;
} completion:^(BOOL finished) {
if (finished) {
NSLog(@"animated");
}
}];
myCount++;
}
}
这个方法是从viewdidload方法中调用的,
我知道这很粗糙,但这是我最好的尝试,如果您对我如何实现这一点有任何想法,将不胜感激。
【问题讨论】:
标签: iphone ios uibutton uiviewanimation