When a UITextField with custom frame (200 × 54 px) loses focus, the text looks blurred.

(source: idzr.org)
Is this a common problem? Is there any workaround / solution known?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I found a number of references to this bug through Google, but everybody worked around it by playing with font sizes. After much hunting I found this thread that says anti-aliasing is applied when a view’s frame contains fractional pixel values, e.g. if you calculate its size as a fraction of the super view.
Sure enough, casting the
CGRectvalues tointfor the view’s frame worked perfectly. So as an example, if you wanted your text field to be centered vertically in the superview, you should use anintcast like this:There is also the
CGRectIntegralfunction that you can use to convert aCGRectto integral values.