//*********动画翻转并改变View颜色
- (void)changeColor:(UIView *)view
{
if (view.backgroundColor==[UIColor yellowColor])
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.8];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:view cache:YES];//未起作用
[UIView commitAnimations];
view.backgroundColor = [UIColor blackColor];
}
else if (view.backgroundColor == [UIColor blackColor])
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.8];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:view cache:YES];
[UIView commitAnimations];
view.backgroundColor = [UIColor yellowColor];
}
}
UI控件使用案例<四>
最新推荐文章于 2018-08-03 19:53:24 发布