CGAffineTransform函数旋转操作

本文转载至  http://blog.sina.com.cn/s/blog_923fdd9b0101ahyx.html

 
首先获取UITableView的CGAffineTransform函数:
CGAffineTransform transform=self.mytableview.transform;
对获取的CGAffineTransform函数进行旋转,旋转角度为逆时针旋转90度:
    transform=CGAffineTransformRotate(transform, -M_PI/2.0);
将新获取的CGAffineTransform函数赋给UITableView,即可旋转:
    self.mytableview.transform=transform;
 
3D旋转
 

//set default transform

            CATransform3D transform = CATransform3DMakeTranslation(0.0f, 0.0f, -15.0f);

            transform = CATransform3DRotate(transform, (CGFloat)M_PI + 0.4f, 0.0f, 0.0f, 1.0f);

            transform = CATransform3DRotate(transform, (CGFloat)M_PI_4, 1.0f, 0.0f, 0.0f);

            transform = CATransform3DRotate(transform, -0.4f, 0.0f, 1.0f, 0.0f);

            transform = CATransform3DScale(transform, 3.0f, 3.0f, 3.0f);

            self.modelView.modelTransform = transform;

 

 

转载于:https://www.cnblogs.com/Camier-myNiuer/p/4329693.html

你可能感兴趣的:(CGAffineTransform函数旋转操作)