白い画像ボタンがあります。クリックすると、下から上にアニメーション化して黄色のボタン画像に変わります。もう一度黄色のボタン画像をクリックすると、上から下にアニメーション化して白い画像のボタン画像に変わる必要があります。
これは私が試したものです:
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:@"yellowimg.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) {
}];