大佬教程收集整理的这篇文章主要介绍了iPhone / iPad – 核心动画 – CGAffineTransformMakeTranslation不会修改框架,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
UIView *rectangleView = [detailView viewWithTag:4]; //the actual frame is (20.0,30.0,884.0,600.0) [UIView animateWithDuration:0.5 animations:^{ [rectangleView setTransform:CGAffineTransformMakeTranslation(-1000,0)]; } completion:^(BOOL finished) { [rectangleView removeFromSuperview]; UIView *otherView = [[UIView alloc] initWithFrame:CGRectMake(1020.0,600.0)]; [otherView setBACkgroundColor:[UIColor purpleColor]]; [otherView setTag:4]; [detailView addSubview:otherView]; [UIView animateWithDuration:0.5 animations:^{ [otherView setTransform:CGAffineTransformMakeTranslation(-1000,0)]; } completion:^(BOOL finished) { [otherView release]; }]; }];
>将转换应用于视图已有的转换:
CGAffineTransform newTransform = CGAffineTransformConcat(rectangleView.transform,CGAffineTransformMakeTranslation(-1000,0)); [rectangleView setTransform:newTransform];
>而不是应用变换直接操作视图位置(例如通过其中心属性)
UIView *rectangleView = [detailView viewWithTag:4]; //the actual frame is (20.0,600.0) CGAffineTransform tf = CGAffineTransformMakeTranslation(-1000,0); [UIView animateWithDuration:0.5 animations:^{ [rectangleView setCenter: CGPointApplyAffineTransform(rectangleView.center,tf)]; } completion:^(BOOL finished) { [rectangleView removeFromSuperview]; UIView *otherView = [[UIView alloc] initWithFrame:CGRectMake(1020.0,600.0)]; [otherView setBACkgroundColor:[UIColor purpleColor]]; [otherView setTag:4]; [detailView addSubview:otherView]; [UIView animateWithDuration:0.5 animations:^{ [otherView setCenter: CGPointApplyAffineTransform(otherView.center,tf)]; } completion:^(BOOL finished) { [otherView release]; }]; }];
以上是大佬教程为你收集整理的iPhone / iPad – 核心动画 – CGAffineTransformMakeTranslation不会修改框架全部内容,希望文章能够帮你解决iPhone / iPad – 核心动画 – CGAffineTransformMakeTranslation不会修改框架所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。