在我的iPad应用程序中,我注意到iOS 6和iOS 7在UITextFields上的不同行为.
我创建UITextField如下:
UIButton *theButton = (UIButton*)sender;
UITextField *textField = [[UITextField alloc] initWithFrame:[theButton frame]];
[textField setDelegate:self];
[textField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter];
[textField setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
textField.textAlignment = UITextAlignmentRight;
textField.keyboardType = UIKeyboardTypeDefault;
...
[textField becomeFirstResponder];
在iOS 6中,当我键入"hello world"时,当我在"hello"之后点击空格键时,光标会向前移动一个空格
在iOS 7中,当我点击空格键时,光标不会前进.然而,当我在"世界"中输入"w"时,它显示了空间和w.
在iOS 7中,当空格键被点击时,如何推进光标?
更新:
如果我更改文本字段.textAlignment到UITextAlignmentLeft,然后空格出现在iOS 7中.如果可能的话,我想让它保持正确对齐.