我的UITableViewCell
选择有问题。我正在使用 UITableViewCell
带有UITextView
子视图的 a。在启用用户交互的情况下,该UITextView
对象不可编辑、不可滚动。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell=[[[NSBundle mainBundle]loadNibNamed:@"DemoCell" owner:self options:nil]objectAtIndex:0];
cell. accessoryType=UITableViewCellAccessoryDisclosureIndicator;
}
if([distanceArray count]){
UILabel *label1=(UILabel*)[cell viewWithTag:1];
label1.text=[locationNameArray objectAtIndex:[indexPath section]];
label1.textColor=[UIColor blueColor];
UILabel *label2=(UILabel*)[cell viewWithTag:2];
[label2 setText:[distanceArray objectAtIndex:[indexPath section]]];
UITextView *tview=(UITextView*)[cell viewWithTag:3];
[tview setText:[discriptionArray objectAtIndex:[indexPath section]]];
return cell;
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
DetailedLocationVIew *dView=[[DetailedLocationVIew alloc]initWithNibName:@"DetailedLocationVIew" bundle:nil];
[self.navigationController pushViewController:dView animated:YES];
[dView release];
}
如果我在 上选择单元格UITextView
,则代表didSelectRowIndexPath
不会打电话。除了过度UITextView
对象和选择工作正常吗?为什么选择不能在 UITextView 上工作?