原因:tableview刷新后重新创建了TextField,造成有多个TextField,形成遮挡。
解决方案:判断TextField是否被创建,如果被创建则不重复创建。
if (self.bankCardText == nil) {
UITextField *bankCardText = [[UITextField alloc] initWithFrame:CGRectMake(100, 0, SCREEN_WIDTH - 100, 51)];
bankCardText.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入银行卡号" attributes:@{NSForegroundColorAttributeName: [UIColor commonGrayColor]}];
bankCardText.keyboardType = UIKeyboardTypeNumberPad;
[bankCardText setDelegate:self];
[cell.contentView addSubview:bankCardText];
self.bankCardText = bankCardText;
}