【发布时间】:2012-06-06 18:17:50
【问题描述】:
我将 UIButton 子类化以创建自己的 UIRoundButton。我正在尝试为一个名为 radius 的自定义属性设置动画。它确实发生了变化,但它立即发生了变化。我尝试将动画持续时间增加到 5000,但动画仍在毫秒内发生。
代码如下:
UIRoundButton *tempItem = [self.buttons objectAtIndex:currentElement];
[tempItem setInnerColor:UIColorFromRGB(0xcdcdcd)];
currentElement = currentElement + 1;
UIRoundButton *tempItem2 = [self.buttons objectAtIndex:currentElement];
[tempItem2 setInnerColor:UIColorFromRGB(0xff0000)];
[UIView beginAnimations:@"ToggleViews" context:nil];
[UIView setAnimationDuration:5000];
tempItem.radius = 20;
tempItem2.radius = 40;
[UIView commitAnimations];
有什么想法吗?
【问题讨论】:
标签: ios uiview core-animation