DNB*_*ims 1 iphone objective-c iphone-sdk-3.0
我想将UIButton背景颜色从黑色更改为白色.但我想在动画中改变它.例如......黑色>灰色>白色.在iPhone SDK中有没有简单的方法?谢谢.
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 300, 50)];
[button setTitle:@"hi" forState:UIControlStateNormal];
[button setBackgroundColor:[UIColor blackColor]];
[self.view addSubview:button];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.5];
button.backgroundColor = [UIColor whiteColor];
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3246 次 |
| 最近记录: |