美文网首页
CGAffineTransform

CGAffineTransform

作者: iChuck | 来源:发表于2017-10-25 21:58 被阅读10次

    self.tempView.transform = CGAffineTransformIdentity;

    // CGAffineTransform 方法时在按钮的上次变形的累加

    self.tempView.transform = CGAffineTransformScale(self.tempView.transform, 0.8, 0.8);

    self.tempView.transform = CGAffineTransformRotate(self.tempView.transform, M_PI_4);

    self.tempView.transform = CGAffineTransformTranslate(self.tempView.transform, dx, dy);

    // transform:形变属性,能完成的功能:平移、缩放、旋转 CGAffineTransformMake 方法则是相对于初始位置变化

    // 缩放

    self.tempView.transform = CGAffineTransformMakeScale(0.5, 0.5);

    // 平移

    self.tempView.transform = CGAffineTransformMakeTranslation(-100, 100);

    // 旋转

    self.tempView.transform = CGAffineTransformMakeRotation(-M_PI_4);

    CGAffineTransform translation = CGAffineTransformMakeTranslation(-100, 100);

    CGAffineTransform scaleTranslation = CGAffineTransformScale(translation, 0.5, 0.5);

    CGAffineTransform rotateScaleTranslation = CGAffineTransformRotate(scaleTranslation, M_PI_2);

    self.tempView.transform = rotateScaleTranslation;

    相关文章

      网友评论

          本文标题:CGAffineTransform

          本文链接:https://www.haomeiwen.com/subject/kxwfuttx.html