我想要做的是,当用户单击按钮时,按钮应该用从下到上的动画填充颜色。
我试过这个添加颜色但没有添加动画效果。
float originalY = btn.frame.origin.y;
float originalH = btn.bounds.size.height;
[UIView animateWithDuration:3.0f
delay:1.0f
options:UIViewAnimationOptionTransitionFlipFromBottom
animations:^{
btn.frame = CGRectMake(btn.frame.origin.x, (originalY + originalH), btn.bounds.size.width, 0);
[btn setBackgroundImage:[UIImage imageNamed:@"Screen Shot 2012-11-07 at 4.22.30 PM.png"] forState:UIControlStateNormal];
[btn setTitleColor:[[UIColor alloc]initWithRed:38.0/255.0 green:38.0/255.0 blue:38.0/255.0 alpha:1.0] forState:UIControlStateNormal];
} completion:^(BOOL finished) {
}];