Swastik
Swastik

Reputation: 2425

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 the left.

Upvotes: 3

Views: 8332

Answers (1)

Seega
Seega

Reputation: 3390

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

Upvotes: 1

Related Questions