ios tableview/collectionView关于点击cell后 刷新cell
来源:互联网 发布:q扫雷软件 编辑:程序博客网 时间:2024/05/14 15:39
ios tableview/collectionView关于点击cell后 刷新cell
用数组记录点击cell的索引值,然后用数组的- (BOOL)containsObject:(ObjectType)anObject;这个方法判断该点击cell的索引值是否在数组中,来进行相应的操作。
#pragma mark - UICollectionViewDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return 50;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
WLSelectSeatCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:seatCell forIndexPath:indexPath];
cell.titleLabel.text = [NSString stringWithFormat:@"%ld",indexPath.row +1];
if ([self.seatArray containsObject:indexPath])
{
cell.titleLabel.textColor = [UIColor redColor];
cell.titleLabel.layer.borderColor = [UIColor redColor];
}
else
{
cell.titleLabel.textColor = [UIColor lightGrayColor];
cell.titleLabel.layer.borderColor = [UIColor lightGrayColor].CGColor;
}
return cell;
}
#pragma mark - UICollectionViewDelegateFlowLayout
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
if ([self.seatArray containsObject:indexPath])
{
[self.seatArray removeObject:indexPath];
}
else
{
[self.seatArray addObject:indexPath];
}
[self.seatCollectionView reloadData];
}
- ios tableview/collectionView关于点击cell后 刷新cell
- tableview上cell 加载collectionview
- 点击tableview里的cell后改变cell的背景图片
- ios collectionView点击后只选中一个cell并改变样式
- iOS刷新tableView某个cell或section
- iOS tableView刷新选中cell数据
- IOS中点击TableView的Cell跳转
- tableView中cell、collectionView中cell选中后,图片加上一层高亮效果 selected highlighted
- tableView,collectionView如何获取当前cell?
- swfit的tableview下拉刷新,点击cell异常,弹窗UIAlertController
- iOS tableview自定义cell
- 关于tableView 删除cell
- 在tableView或者collectionView里如何获得被点击的cell的下标位置
- TableView 或者collectionView 获取点击的cell 和当前行数的方法
- Tableview 每行cell点击后扩展出一行
- tableView cell 的刷新 插入
- TableView中的cell不可点击
- tableview点击获取该行cell
- 在js传递参数中含加号(+)的处理方式
- angularjs向指令中传递数据
- 15. 3sum(重要)
- matlab读入多张图片
- Java内部抽象类的匿名类初始化
- ios tableview/collectionView关于点击cell后 刷新cell
- 【Java并发编程】之十六:深入Java内存模型——happen-before规则及其对DCL的分析(含代码)(r)
- python 安装wxPython
- 让动画循环播放的方法
- 这一次,我优化了37%的内存
- JNI NDK开发Crash错误定位 调试
- Proj~onStreetPaking的几个知识点和问题
- 日历--给input赋值
- php通过ssh2扩展控制linux,模拟阿里云web控制台