设为首页 加入收藏

TOP

iOS开发UI篇-tableView在编辑状态下的批量操作(多选)(二)
2017-10-13 10:32:58 】 浏览:1382
Tags:iOS 开发 UI篇 -tableView 编辑 状态 批量 操作 多选
}
return _array; } - (NSMutableArray *)selectorPatnArray{ if (!_selectorPatnArray) { _selectorPatnArray = [NSMutableArray array]; } return _selectorPatnArray; }

如果要把tableView在非编辑状态下不让点击,设置下这个属性,就OK了.

@property (nonatomic) BOOL allowsSelection NS_AVAILABLE_IOS(3_0);  // default is YES. Controls whether rows can be selected when not in editing mode

 如果在某些情况下需要全选,可以按照这个思路:

        for (int i = 0; i < self.array.count; i++) {
            NSIndexPath *path = [NSIndexPath indexPathForRow:i inSection:0];
            UITableViewCell *cell = (UITableViewCell *)[self.tableView cellForRowAtIndexPath:path];
            cell.selected = YES;
            [self.selectorPatnArray addObject:self.array[i]];//添加到选中列表

        }

这只是个人想法,欢迎指出不足......

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Runtime的几个小例子(含Demo) 下一篇网络安全——Base64编码、MD5、SH..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目