UITextField text alignment in ios 4.2
I have a strange problem.
UITextField *txtField;
txtField.textAlignment = UITextAlignmentCenter;
This code works well in ios 3.0 & 4.0.(the cursor blinks in the center & textAlignment while typing text is also in center)
However, in ios 4.2, text Alignment remains center but the cursor blinks in 开发者_JAVA技巧the left.
works fine for me on ios 4.2. cursor is in center and wents to right on writing.
text = [[UITextField alloc] initWithFrame:CGRectMake(80.0, 8.0, 210.0, 30.0)];
text.clearsOnBeginEditing = YES;
text.delegate = self;
text.borderStyle = UITextBorderStyleRoundedRect;
text.textAlignment = UITextAlignmentCenter;
this is my code
精彩评论