I am almost done implementing a UITableViewCell with a UITextField in it. Rather then going through CGRectMake and UITableViewCe
inside the cell for row at index path add this line which is given in bold,
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"Cell"];
[cell setSelectionStyle:UITableViewCellSelectionStyleBlue];
amountField = [[UITextField alloc] initWithFrame:CGRectMake(110, 10, 190, 30)];
amountField.placeholder = @"Enter amount";
amountField.keyboardType = UIKeyboardTypeDecimalPad;
amountField.textAlignment = UITextAlignmentRight;
amountField.clearButtonMode = UITextFieldViewModeNever;
[amountField setDelegate:self];
[[cell textLabel] setText:@"Amount"];
**for (UIView *cellSubViews in cell.subviews) {
cellSubViews.userInteractionEnabled = NO;
}**
[cell addSubview:amountField];
return cell;
}
try this, it will work