Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do antialiasing on a rotated UIView (NOT UIImageView)

My issue is basically the the same as this one. I have a UIView and when I rotate it usding CGAffineTransformMakeRotation, the edges are not being antialiased.

I tried both adding the view as a subview in a bigger UIView and using a transparent border on the view but none of these worked.

The OP of the aforementioned post solved this by making an image with transparent borders in photoshop and using a UIImageView instead but I cannot do the same because the size of the UIView is determined on runtime.

Does anyone know any solutions to this problem?

Note that this is not a duplicate of this post because I am interested in using a UIView and NOT a UIImageView.

like image 597
Kremk Avatar asked Oct 12 '11 12:10

Kremk


1 Answers

Try setting UIViewEdgeAntialiasing=YES in your App-info.plist

like image 73
trackmate Avatar answered Nov 12 '22 02:11

trackmate