I have declared UITableView in .h files. I have 5 sections in the table view, now I have to set tableview.editing = yes for table 4.
How do I show the +
button near section 4 and there are all the other sections in the edit?
myTableView = [[UITableView alloc] initWithFrame: CGRectMake (0,0,320,415) style: UITableViewStyleGrouped]; MyTableView.delegate = self; MyTableView.dataSource = self; [MyTableView Set Set Action Futurahight: 0]; [Set MyTableView with HeaderHight: 15]; [MyTableView Set Separator Color: [UIColor lightGrayColor]]; MyTableView.backgroundColor = [UIColor colorWithRed: 0.85546875 Green: 0.8828125 Blue: 0.92578125 alpha: 1]; [MyView addSubview: myTableView]; I tried to do this, it is not working. - (NSInteger) Table view: (UITableView *) tableview numberoffrace ins: (section) = {if (section == 0) {myTableView.editing = NO; MyTableView.allowsSelectionDuringEditing = No; Return 3; } And if (section == 1) {myTableView.editing = NO; MyTableView.allowsSelectionDuringEditing = No; Return 2; } And if (section == 4) {myTableView.editing = yes; MyTableView.allowsSelectionDuringEditing = Yes; If (isEdit == YES) {if ([editObject.contactList count]> 0) {Return [editObject.contactList count] +1; } And {return1; }} And if (is not edit == no) {if ([addContactList count]> 0) {return [addContactList count] +1; } And {return1; }}} And if (section == 2) {myTableView.editing = NO; MyTableView.allowsSelectionDuringEditing = No; Return 1; } And if (section == 3) {myTableView.editing = NO; MyTableView.allowsSelectionDuringEditing = No; Return 1; } Return 0; }
I am getting the +
button in the fourth section, but all the other sections are moved to the right.
implementation
- (BOOL) tableview: (UITableView *) Table view can be EiditRowAtIndexPath: (NSIndexPath *) indexPath {// If you do not want the specified item to be editable, then return the number Yes return; }
Comments
Post a Comment