UITextField 初始光标初始位置如何居右闪烁 占位符如何居右显示

UITextField *tf = [[UITextField alloc] initWithFrame:CGRectMake(100, 100, 300, 28)];
    tf.borderStyle = UITextBorderStyleRoundedRect;
    [self.view addSubview:tf];
    tf.placeholder = @"说点什么";
    tf.textAlignment = NSTextAlignmentRight;

关键代码  

  tf.textAlignment = NSTextAlignmentRight;

猜你喜欢

转载自blog.csdn.net/allanGold/article/details/85132101