Uitableview 当我点击UILabel时,闪烁的光标会显示出来,再加上键盘的外观

Uitableview 当我点击UILabel时,闪烁的光标会显示出来,再加上键盘的外观,uitableview,uilabel,first-responder,Uitableview,Uilabel,First Responder,我已经构建了一个带有两个单元格的自定义UITableView。我在一个单元格中添加了UIImageView,在另一个单元格中添加了UILabel。当我点击带有UILabel的单元格时,会弹出一个不需要的键盘,并显示一个闪烁的光标。我已检查以确保我没有使用重复的重用标识符。为什么会这样?我以为你不用键盘。我怎样才能摆脱这个?是否有一种方法可以通过委托方法访问单元格,如 - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRow

我已经构建了一个带有两个单元格的自定义UITableView。我在一个单元格中添加了UIImageView,在另一个单元格中添加了UILabel。当我点击带有UILabel的单元格时,会弹出一个不需要的键盘,并显示一个闪烁的光标。我已检查以确保我没有使用重复的重用标识符。为什么会这样?我以为你不用键盘。我怎样才能摆脱这个?是否有一种方法可以通过委托方法访问单元格,如

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath

提前感谢你的帮助。这是我的密码:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{   
 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:qRViewCellIdentifier];

 NSUInteger row = [indexPath row];
 if (cell == nil)
 {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:qRViewCellIdentifier] autorelease];

  if (row == kQRRowIndex)
  {
   CGRect imageRect = CGRectMake(10,10.0,255.0,255.0);
   UIImageView *qRImageView = [[[UIImageView alloc] initWithFrame:imageRect] autorelease];
   qRImageView.tag = row;
   [cell.contentView addSubview:qRImageView];
   cell.selectionStyle = UITableViewCellSelectionStyleNone;
  }
  else
  {
   CGRect labelRect = CGRectMake(10,10.0,255.0,25.0);
   UILabel *fastPayLabel = [[UITextField alloc] initWithFrame:labelRect];
   fastPayLabel.tag = row;
   [cell.contentView addSubview:fastPayLabel];
  }
 }

 if (row == kQRRowIndex)
 {
  UIImageView *qRImageView = (UIImageView *)[cell viewWithTag:kQRRowIndex];
  qRImageView.image = [[UserManager sharedUserManager] qRImage];
 }
 else
 {
  NSString *message = [NSString stringWithString:@"Enable Fast Pay"];

  UILabel *fastPayLabel = (UILabel *)[cell viewWithTag:kFastPayRowIndex]; 
  fastPayLabel.textAlignment = UITextAlignmentCenter;
  fastPayLabel.text = message;
  fastPayLabel.font = [UIFont boldSystemFontOfSize:20];
 }

 return cell;
}

伙计,这里有个输入错误:
UILabel*fastPayLabel=[[UITextField alloc]initWithFrame:labelRect]
不是分配UILabel对象,而是实际分配UITextField…=)

伙计,这里有一个输入错误:
UILabel*fastPayLabel=[[UITextField alloc]initWithFrame:labelRect]。
不是分配UILabel对象,而是实际分配UITextField…=)