0
我已經加入到從表中的某些行查看這樣一個文本字段:鍵盤沒有出現在iPhone
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
// cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
// cell.accessoryType = UITableViewCellAccessoryNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.backgroundColor = [UIColor clearColor];
cell.selectionStyle = UITableViewCellSelectionStyleGray;
cell.backgroundView.opaque = NO;
//cell.alpha = 0.65;
cell.textLabel.backgroundColor = [UIColor clearColor];
cell.textLabel.opaque = NO;
cell.textLabel.textColor = [UIColor whiteColor];
cell.textLabel.highlightedTextColor = [UIColor whiteColor];
cell.textLabel.font = [UIFont boldSystemFontOfSize:18];
cell.detailTextLabel.backgroundColor = [UIColor clearColor];
cell.detailTextLabel.opaque = NO;
cell.detailTextLabel.textColor = [UIColor whiteColor];
cell.detailTextLabel.highlightedTextColor = [UIColor whiteColor];
cell.detailTextLabel.font = [UIFont systemFontOfSize:14];
if(indexPath.row==1)
{
code=[[UITextField alloc] init];
code.frame = CGRectMake(200,10,80,50);
code.textColor=[UIColor grayColor];
[email protected]"515800";
[cell.contentView addSubview:code];
}
if(indexPath.row==2)
{
ville=[[UITextField alloc] init];
ville.frame = CGRectMake(200,10,80,50);
ville.textColor=[UIColor grayColor];
[email protected]"Paris";
[cell.contentView addSubview:ville];
}
if(indexPath.row==4)
{
nomdepartenaire=[[UITextField alloc] init];
nomdepartenaire.frame = CGRectMake(200,10,80,50);
nomdepartenaire.textColor=[UIColor grayColor];
[email protected]"Alliantis Ttttt";
[cell.contentView addSubview:nomdepartenaire];
}
}
// Set up the cell...
[[cell textLabel] setText: [listData objectAtIndex:indexPath.row]] ;
return cell;
}
的問題是,如果我想改變文本字段文本鍵盤不會出現。爲什麼?
確保您的arent在文本框 – mayuur
嘗試添加單元格的內容視圖中的文本視圖的頂部添加任何東西: cell.contentView addSubview:LABL 還要檢查文本視圖是細胞視圖框內部(我注意到你的textview的y原點爲10,高度爲50,所以你的表格單元至少要有60的高度)。 – viggio24
也檢查應該啓用單元格的用戶安裝 – Dhawal