下面代碼段是關於ios View 淡入淡出效果的代碼,希望能對各位也有好處。
- (void)TheAnimation{
animation.delegate = self;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
NSUInteger f = [[rView subviews] indexOfObject:fView];
NSUInteger z = [[rView subviews] indexOfObject:zView];
[rView exchangeSubviewAtIndex:z withSubviewAtIndex:f];
[[rView layer] addAnimation:animation forKey:@"animation"];
}