I've got a strange (and very annoying) bug while trying to horizontally centering some text within a UITextField.
I have placed a UITextField using Storyboard with plain-text (not attributed) setting the horizontal alignment to center. Text appears correct aligned (centered) in storyboard but gives different results for different versions of iOS and between simulator and real device:
Simulator iPad with iOS 7.0:
- non-editing mode: centered
- editing mode: centered
- after leaving editing mode: centered
Simulator iPad with iOS 7.1:
- non-editing mode: left aligned
- editing mode: centered
- after editing mode: centered
iPad Air with iOS 7.1:
- non-editing mode: left aligned
- editing mode: centered
- after editing mode: left aligned
Setting the NSTextAlignmentCenter before or after setText has no effect.
Is this a bug in iOS 7.1? Does anyone got the same problem or even a solution for that?