8

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.

Community
  • 1
  • 1
Kremk
  • 149
  • 2
  • 8

2 Answers2

20

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

trackmate
  • 248
  • 2
  • 8
0

I solved this by creating a 3x3 px image in photoshop. The center pixel of the image has the color I wanted my background to have and the rest of the pixels are transparent. Then I was able to use an instance of UIImageView and to define the frame size at runtime by using the -stretchableImageWithLeftCapWidth:topCapHeight: method.

This solution, of course still does not work for UIViews but that way you can circumvent the "variable size" issue and use a UIImageView instead.

Kremk
  • 149
  • 2
  • 8