自定义文本字段仅在iOS 7中添加回表格单元格

时间:2014-02-11 10:25:06

标签: uitableview ios7

在下面的代码中,cellTextField正在添加回Mastercell,这只发生在iOS7中,如果它回到单元格意味着我无法输入用户名和密码。但它的工作离子是iOS6。

- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    MasterCell *cell;

    // country
    if (indexPath.row == 0) {
        cell = [aTableView dequeueReusableGLCCellWithIdentifier:[[self class] cellIdentifierTextField] forIndexPath:indexPath];

        cell.textLabel.text = NSLocalizedString(@"USERNAME", @"Username");


        ((CellTextField *)cell).textField.keyboardType = UIKeyboardTypeEmailAddress;
        ((CellTextField *)cell).textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
        ((CellTextField *)cell).didEndEditingBlock = [self cellTextFieldDidEndEditingBlockWithIndexPath:indexPath];
        //UITextField *sText = [UITextField alloc] initWithFrame:CGRectMake(180, 0, 80, 44);


    }
    else if (indexPath.row == 1) {
        cell = [aTableView dequeueReusableGLCCellWithIdentifier:[[self class] cellIdentifierTextField] forIndexPath:indexPath];

        cell.textLabel.text = NSLocalizedString(@"PASSWORD", @"Password");
        ((CellTextField *)cell).textField.secureTextEntry = YES;



        ((CellTextField *)cell).didEndEditingBlock = [self cellTextFieldDidEndEditingBlockWithIndexPath:indexPath];
    }


    return cell;
}

0 个答案:

没有答案