//动画执行开始
[UIViewbeginAnimations:nil context:nil];
[UIViewsetAnimationCurve:UIViewAnimationCurveEase InOut];
[UIViewsetAnimationRepeatAutore verses:NO];
[UIViewsetAnimationTransition:UIViewAnimationTransitio nNone forView:selfcache:YES];
[UIViewsetAnimationDuration:kAnimationDuration];
//设置要变化的frame 推入与推出修改对应的frame即可
CGRect frame= self.frame;
frame.origin.x -= (frame.size.width - offsetWidth);
self.frame =frame;
//执行动画
[UIViewcommitAnimations];
UIView平移的推入推出动画
最新推荐文章于 2022-06-30 10:56:11 发布