質問

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?

役に立ちましたか?

解決

"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;
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top