我使用的是 iPhone6+ 和 iOS 8.3。
何时,我想将 UITextField 对齐设置为右侧。但是当我发送它时,输入文本会跳到左边。
[tf setBackgroundColor:[UIColor clearColor]];
tf.attributedPlaceholder = [[NSAttributedString alloc] initWithString:placeholder attributes:@{NSForegroundColorAttributeName:ISMColor(123, 123, 129)}];
tf.delegate = self;
tf.placeholder = placeholder;
[tf setTextAlignment:NSTextAlignmentRight];
[tf setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];