-(void)removeTip:(UIView *)tip
{
[UIView animateWithDuration:0.5
animations:^{tip.alpha = 0.0;}
completion:^(BOOL finished){ [tip setHidden:YES]; }];
}//隐藏动画
[self performSelector:@selector(removeTip:) withObject:tipView afterDelay:1.5f];
本文介绍了一个简单的Objective-C方法,用于实现UIView的淡出隐藏动画效果。通过UIView动画块,该方法能在指定时间内使视图透明度渐变为0,并最终隐藏视图。
-(void)removeTip:(UIView *)tip
{
[UIView animateWithDuration:0.5
animations:^{tip.alpha = 0.0;}
completion:^(BOOL finished){ [tip setHidden:YES]; }];
}//隐藏动画
[self performSelector:@selector(removeTip:) withObject:tipView afterDelay:1.5f];

被折叠的 条评论
为什么被折叠?