Hi all,
On my iphone app, I have a UITableView in edit mode, where user is allowed only to reorder the rows no delete permission is given.
So is there any way where I can hide "-" red button from TableView. Please let me know.
Thanks
Hi all,
On my iphone app, I have a UITableView in edit mode, where user is allowed only to reorder the rows no delete permission is given.
So is there any way where I can hide "-" red button from TableView. Please let me know.
Thanks
canEditRowAtIndexPath
in UITableViewDataSource
is the function you want - return NO. canMoveRowAtIndexPath
, allowing you to move rows, is something else.
Is working
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleNone;
}
But not able to align table section. If we hide the "-" button still the space remain same. Can any one help to make table section left align
Here is my complete solution, without indentation (0left align) of the cell!
(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { return YES; }
(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{ return UITableViewCellEditingStyleNone; }
(BOOL)tableView:(UITableView *)tableview shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath { return NO; }
(BOOL)tableView:(UITableView *)tableview canMoveRowAtIndexPath:(NSIndexPath *)indexPath { return YES; }