ios – 禁用删除但在UITableView中启用移动单元格

ios – 禁用删除但在UITableView中启用移动单元格,第1张

概述我知道这两种方法 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{ return indexPath.section == 0;}- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexP 我知道这两种方法
- (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中启用移动单元格所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1103613.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存