- (BOol)tableVIEw:(UItableVIEw *)tableVIEw canEditRowAtIndexPath:(NSIndexPath *)indexPath{ return indexPath.section == 0;}- (BOol)tableVIEw:(UItableVIEw *)tableVIEw canMoveRowAtIndexPath:(NSIndexPath *)indexPath{ return YES;}
但是我们如何禁用删除但在UItableVIEw中启用移动单元格?
解决方法 尝试将以下委托方法添加到您的代码中.- (UItableVIEwCellEditingStyle)tableVIEw:(UItableVIEw *)tableVIEw editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{ return UItableVIEwCellEditingStyleNone; }- (BOol)tableVIEw:(UItableVIEw *)tablevIEw shouldindentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath { return NO;}总结
以上是内存溢出为你收集整理的ios – 禁用删除但在UITableView中启用移动单元格全部内容,希望文章能够帮你解决ios – 禁用删除但在UITableView中启用移动单元格所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)