UITableViewCell设置 checkmark的问题
2012-08-29 10:41
561 查看
之前设置UITableViewCell的checkMark的属性,有20个cell
选择其中的一个进行设置checkmark ,但是一直无法设置成功,之前采用的方式是通过indexPath来标记
将上一个indexPath设置为oldIndexPath, 但是无法标记成功,后面把上一个 UITableViewCell 来作为标记,可以解决。
代码如下
选择其中的一个进行设置checkmark ,但是一直无法设置成功,之前采用的方式是通过indexPath来标记
将上一个indexPath设置为oldIndexPath, 但是无法标记成功,后面把上一个 UITableViewCell 来作为标记,可以解决。
代码如下
[tableView deselectRowAtIndexPath:indexPath animated:YES]; if ([indexPath section] == 0) { if (self.wallpaperIndexpath != nil) { wallpaperOldCell.accessoryType = UITableViewCellAccessoryNone; } [[tableView cellForRowAtIndexPath:indexPath] setAccessoryType:UITableViewCellAccessoryCheckmark]; wallpaperOldCell = [tableView cellForRowAtIndexPath:indexPath]; self.wallpaperIndexpath = indexPath; NSLog(@"Wallpaper new index path is %@", indexPath); }else if ([indexPath section] == 1){ if (self.ringtoneIndexpath != nil) { ringtoneOldCell.accessoryType = UITableViewCellAccessoryNone; } [[tableView cellForRowAtIndexPath:indexPath] setAccessoryType:UITableViewCellAccessoryCheckmark]; ringtoneOldCell = [tableView cellForRowAtIndexPath:indexPath]; self.ringtoneIndexpath = indexPath; NSLog(@"Ringtone new index path is %@", indexPath); }
相关文章推荐
- IOS问题汇总:2014-12-17 确定UITableViewCell AccessoryCheckmark唯一性+不唯一性
- 有关XCode6(iOS8)UITableViewCell与iOS7在UITableViewCell问题
- iOS UITableViewCell重用问题
- iOS UITableViewCell自适应高度单元格问题?
- 解决多行cell 设置头像变圆 导致变卡的问题
- UITableViewCell里面separator的设置
- uitableview 两种设置重用cell的方式
- iOS UITableViewCell重用机制避免重复显示问题
- UITableViewCell设置背景图片
- UITableViewCell的选中时的颜色设置
- 【控件】UITableView自定义cell时,设置控件frame问题
- iOS 8 自适应 Cell,UITableViewAutomaticDimension设置无效,滚动后显示正常
- cell中button怎么得到对应cell的indexpath 以及关于UITableViewCellContentView的问题
- 点击Cell的时候 出现一个 小对勾的( 确定UITableViewCell AccessoryCheckmark唯一性)
- ios学习之——ios6之后UITableViewCell添加子视图所遇到的问题
- 设置了table-cell 属性后,用百分比来设置宽度为什么会出现问题
- UITableViewCell的自定义问题
- UITableViewCell 间距问题
- UITableViewCell分割线(样式,宽度·高度调整,颜色等的设置)
- 给UIColloectionViewCell设置点击效果,解决点击效果错位的问题