开发者

Setting re-ordering property of a cell to NO

开发者 https://www.devze.com 2023-03-07 15:54 出处:网络
Can we specifically set the re-ordering property of a cell (Add c开发者_运维问答ell with + button) to NO? I cannot set editingStyle to NO as then I would not get even the + button in Add cell.Use the

Can we specifically set the re-ordering property of a cell (Add c开发者_运维问答ell with + button) to NO? I cannot set editingStyle to NO as then I would not get even the + button in Add cell.


Use the delegate method: tableView:canMoveRowAtIndexPath:.

You should use it by checking to see what the indexPath is and then return NO if the indexPath is the indexPath of a cell you do not want reorderingEnabled on.


You can set a cell's showsReorderControl to NO, implement tableView:moveRowAtIndexPath:toIndexPath:and return NO for tableView:canMoveRowAtIndexPath:.

http://developer.apple.com/library/ios/documentation/uikit/reference/UITableViewCell_Class/Reference/Reference.html#//apple_ref/occ/instp/UITableViewCell/showsReorderControl

0

精彩评论

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