I'm not sure if I found an error or missed some complicated settings in the iOS SDK.
I have a UITextField with the right aligned text and some placeholder text. I configured it to automate when switching from portrait to landscape (IB settings look like this: http://db.tt/laTmXIS ).
When in the portrait everything works as expected: http://db.tt/skf8wqN However, after turning the text, the placeholder is in the wrong place: http://db.tt/7pU5kdR
It seems to me that the auto-implementation properties are not replicated to the subhead of the UILabel subclass.
I reproduced this in a new project (download here: http://db.tt/OSnvv2Y ), so nothing is scared in my code so far I see.
Any ideas?
Update: Dan workaround resolves this. Add an IBOutlet connected to your text field, and then add this code to your UIViewController ...
- (void)didRotateFromInterfaceOrientation: (UIInterfaceOrientation)fromInterfaceOrientation { textField.textAlignment = UITextAlignmentLeft; textField.textAlignment = UITextAlignmentRight; }
ios objective-c iphone uitextfield
Ian kershaw
source share