1
我試着如下動畫顏色變化:動畫效果的顏色變化從頂部到底部,反之亦然
[UIView animateWithDuration:1.0 delay:0.2 options:UIViewAnimationOptionCurveEaseIn animations:^{
self.view.backgroundColor = [UIColor greenColor];
} completion:^(BOOL finished)
{
NSLog(@"Color transformation Completed");
[UIView animateWithDuration:1.0 delay:0.2 options:UIViewAnimationOptionCurveEaseOut animations:^{
self.view.backgroundColor = [UIColor whiteColor];
} completion:^(BOOL finished)
{
NSLog(@"Color transformation Completed");
}
];
}
];
我想要的顏色從頂部流到底部,因爲它充滿綠色的顏色和它的整個屏幕應該用白色從下到上填充。
所以我用填充綠色的UIViewAnimationOptionCurveEaseIn
而填充白色的options:UIViewAnimationOptionCurveEaseOut
但我無法得到想要的效果。爲什麼?