默认情况下如何使UITableViewCells处于编辑状态 [英] How to make UITableViewCells be selected by default for Editing

查看:46
本文介绍了默认情况下如何使UITableViewCells处于编辑状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在上面的屏幕截图中,我通过单击手动选择了单元格,但是我希望默认情况下要选择所有单元格进行编辑.

In the screenshot above I have manually selected the cells by clicking them but I want all the cells to be selected for editing by default.

推荐答案

您可以使用此代码....

You can use this code....

 for(int i=0; i<[array count]; i++)
 {
     NSIndexPath *indexP = [NSIndexPath indexPathForRow:i inSection:0];
    [tblView selectRowAtIndexPath:indexP animated:NO scrollPosition:UITableViewScrollPositionNone];
    [self tableView:tblView didSelectRowAtIndexPath:indexP];
 }

其中 tblView 是您的 tableView .

这篇关于默认情况下如何使UITableViewCells处于编辑状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆