how to not select uitextfield that is in uitableviewcell
I am trying to load a new view from a tableview:didSelectRowAtIndexPath: method that happens when the uitableviewcell is selected, but because I have a custom uitextfield on that uitableviewcell it selects that text field instead of selecting 开发者_如何学Pythonthe uitableviewcell.. how do I stop this from happening?
I do not know what your goal is... But you can solve your problem by using CGRectMake(110, 10, 185, 30)]
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
cell.selectionStyle= UITableViewCellSelectionStyleNone;
UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(110, 10, 185, 30)];
textField.clearsOnBeginEditing = NO;
textField.textAlignment = UITextAlignmentRight;
textField.returnKeyType = UIReturnKeyDone;
textField.textColor = [UIColor blackColor];
textField.font = [UIFont systemFontOfSize:15];
textField.delegate = self;
[cell.contentView addSubview:textField];
This way, the UItextField will be on the right half of the tableView and you can touch the left half of the tableView to select a row.
精彩评论