Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Renders with edge antialiasing" causes delay in UIAlertView in iOS 7

Ever since iOS 7, I noticed my UIAlertViews show with a sort of drawing delay- what happens is the screen dims and the UIAlertView's text appears on the screen for just a split second before the actual frame of the alert view appears.

I traced the problem to being due to the "Renders with edge antialiasing" flag set to YES in my application plist file. Turning this off solves the problem (but then I have ugly jaggies on any rotated views, which is what I was using that flag to solve in the first place).

Anyone know how I can have my cake and eat it too? i.e. have edge antialiasing as well as smooth UIAlertViews.

EDIT: On a high level, it seems as though either being able to toggle 'UIViewEdgeAntialiasing' on the fly would do it. Or if there is a way to rotate UIViews with antialiasing directly. Are either of these possible?

like image 731
Keller Avatar asked Nov 13 '13 17:11

Keller


1 Answers

"Renders with edge antialiasing" is very expensive! Use with caution.

Use this little trick instead:

    view.layer.borderWidth = 1;
    view.layer.borderColor = [UIColor clearColor].CGColor;
    view.layer.rasterizationScale = [UIScreen mainScreen].scale;
    view.layer.shouldRasterize = YES;
like image 193
BlackMouse Avatar answered Nov 11 '22 02:11

BlackMouse