Please help me fix this issue.
In iOS7, I set the UITextField alignment right. But when I input space as a first character in the text field. The cursor automatically move to left side of the text field as if the textfield is left-aligned.
This issue does not happen in iOS5, iOS6.
I am assuming you don't wanna allow the user to enter space as the first character. If that's true this solution would work.
Wire your editing changed event of UITextField to this method.
- (void)removeSpace : (UITextField *)sender{
if ([sender.text isEqual: @" "]) {
sender.text = @"";
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With