大佬教程收集整理的这篇文章主要介绍了ios – 使用CABasicAnimation切割视图一半,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
CABasicAnimation* animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.x"]; animation.fromValue = @(0); animation.toValue = @(4 * M_PI); animation.repeatCount = INFINITY; animation.duration = 5.0; [self.layer addAnimation:animation forKey:@"rotation"]; CATransform3D transform = CATransform3DIdentity; transform.m34 = 1.0 / -2000; self.layer.transform = transform; self.layer.masksToBounds = NO;
实际视图旋转正常,但它会切断视图的一半.这是我在photoshop中制作的快速图片,以显示我的意思
我现在已经进行了数小时的搜索,而且我似乎无法弄清楚是什么引起了这种情况.任何帮助或输入将不胜感激.谢谢.
编辑:继承人我是如何创建视图的:
UIView* test = [[UIView alloc] initWithFrame:CGRectMake(200,200,100,100)]; test.BACkgroundColor = [UIColor redColor]; [self.view addSubview:test];
在界面生成器中创建的视图上尝试后,它工作正常,但我需要以编程方式进行这些操作.
以上是大佬教程为你收集整理的ios – 使用CABasicAnimation切割视图一半全部内容,希望文章能够帮你解决ios – 使用CABasicAnimation切割视图一半所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。