开发者

iPhone - TableView editing and still be able to select

开发者 https://www.devze.com 2023-04-13 08:48 出处:网络
I am trying to make a table view that should be half editable and half selectable. I can’t get this to work. Do anyone know h开发者_如何学编程ow to make this possible. I need to be able to reorder on

I am trying to make a table view that should be half editable and half selectable. I can’t get this to work. Do anyone know h开发者_如何学编程ow to make this possible. I need to be able to reorder one section of the table view and the other section i need to be able to select.

Also I only want the ReorderControl to be shown, without any other editable control to show. When I make it editable it shrinks my table cells to be smaller. Is there anyway to remove this?


There are several properties on UITableView that will help you out.

  1. [tableView setAllowsSelectionDuringEditing:YES];

Also, the UITableViewDelegate protocol has the following method:

- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath

Just return NO where ever you want the row to not resize.

You can use the delegate method tableView:editingStyleForRowAtIndexPath: to say which rows you want to be able to delete, and the data source method tableView:canMoveRowAtIndexPath: for the reordering.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号