图片旋转(transform)出现锯齿如何解决(转)
原文地址:
http://www.cocoachina.com/bbs/read.php?tid=84629
UIView *myView = [[UIView alloc] initWithFrame:CGRectZero];
CGRect rect = myView.frame;
rect.size = CGSizeMake(100.0, 100.0);
myView.frame = rect;
myView.center = mainScroller.center;
myView.layer.borderColor = [UIColor whiteColor].CGColor;
myView.alpha = 0.5;
myView.layer.borderWidth = 3.0;
myView.backgroundColor = [UIColor blueColor];
[mainScroller addSubview:myView];
[myView release];
CGFloat angle = M_PI / 30.0;
[myView.layer setTransform:CATransform3DRotate(myView.layer.transform, angle, 0.0, 0.0, 1.0)];
myView.layer.shadowOffset = CGSizeMake(0, 2);
//0,2
myView.layer.shadowRadius = 3.0;
myView.layer.shadowColor = [UIColor whiteColor].CGColor;
myView.layer.shadowOpacity = 1.0;
myView.layer.shouldRasterize =
YES
;
myView.layer.edgeAntialiasingMask = kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge;
myView.layer.masksToBounds =
YES
;
作者:心不蒙尘
出处:http://www.cnblogs.com/stan0714/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
该文章也同时发布在我的独立博客中-心不蒙尘。