开发者

UITextField text alignment in ios 4.2

开发者 https://www.devze.com 2023-01-31 15:09 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号