Почему кнопка очистки не совпадает с текстом в UITextField?

У меня есть UITextField в UITableViewCell. По какой-то причине кнопка очистки не совпадает с текстом textField. Вот мой код textField:


cell.selectionStyle = UITableViewCellSelectionStyleNone;
usernameField = [[UITextField alloc] initWithFrame:CGRectMake(22, 10, cell.contentView.frame.size.width, cell.contentView.frame.size.height)];
usernameField.adjustsFontSizeToFitWidth = YES;
usernameField.placeholder = @"Username";
usernameField.backgroundColor = [UIColor clearColor];
usernameField.keyboardType = UIKeyboardTypeDefault;
usernameField.autocapitalizationType = UITextAutocorrectionTypeNo;
usernameField.autocorrectionType = UITextAutocorrectionTypeNo;
usernameField.returnKeyType = UIReturnKeyNext;
usernameField.delegate = self;
usernameField.clearButtonMode = UITextFieldViewModeAlways;
[usernameField setEnabled:YES];
[cell addSubview:usernameField];
[usernameField becomeFirstResponder];
[usernameField release];

И вот картинка, чтобы продемонстрировать проблему: Screenshot

Edit: Я также попытался с - (CGRect) clearButtonRectForBounds: (CGRect) bounds и все еще ничего

5
задан Brant Bobby 9 December 2011 в 17:52
поделиться