Search code examples
iosxcodeios7xcode5

Xcode 5 wrong font size on UITextField after editing


I have UITextFields with custom font and size. Everything worked fine till I changed to Xcode 5 to fix all the changes with new iOS/Xcode. Now when I check my UITextFields they have the right font on placeholder and while editing, but when I stop editing the font size gets bigger. So why now with Xcode 5 it doesn't work?

Screenshots: link

Code to set font hasn't changed:

[_eventName setFont:[UIFont fontWithName:APP_FONT_FUTURASTD_LIGHT size:16]];

Solution

  • I too had an issue when inserting rows in a table - the text field in the table cell would use the UILabel proxy font, not the font set on its font property. Scrolling off the screen and back on would then show the correct font.

    The only way I was able to fix this was to override UITextField, add a custom drawRect - in here I had to set self.font to nil, then reset self.font to the value I desired.

    Chris