1. 程式人生 > >IOS UITextField 設定游標位置

IOS UITextField 設定游標位置

textField.leftView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 8, 0)] autorelease];

 textField.leftView.userInteractionEnabled = NO;

 textField.leftViewMode = UITextFieldViewModeAlways;

// Text 垂直居中

textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;