TableView 点击cell,改变选中cell的高度
来源:互联网 发布:centos入侵 编辑:程序博客网 时间:2024/06/10 06:26
原来的网址:http://mn0421.blog.163.com/blog/static/20492067320131273336326/
交流开发群:132913650
TableView 点击cell,改变选中cell的高度
NSMutableDictionary *selectedIndexes;
- (BOOL)cellIsSelected:(NSIndexPath*)indexPath;
- (void)viewDidLoad
{
[super viewDidLoad];
selectedIndexes = [[NSMutableDictionaryalloc] init];
}
- (BOOL)cellIsSelected:(NSIndexPath*)indexPath {
// Return whether the cell at the specified index path is selected or not
NSNumber *selectedIndex = [selectedIndexes objectForKey:indexPath];
return selectedIndex == nil ? FALSE : [selectedIndex boolValue];
}
//设置行高
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath{
//return 35;
if ([self cellIsSelected:indexPath]) {
return 60;
}
return 35;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
// Deselect cell
[tableViewdeselectRowAtIndexPath:indexPathanimated:TRUE];
// Toggle 'selected' state
BOOL isSelected = ![selfcellIsSelected:indexPath];
// Store cell 'selected' state keyed on indexPath
NSNumber *selectedIndex = [NSNumbernumberWithBool:isSelected];
[selectedIndexessetObject:selectedIndex forKey:indexPath];
// This is where magic happens...
[self.tableView beginUpdates];
[self.tableView endUpdates];
}
- TableView 点击cell,改变选中cell的高度
- TableView 点击cell,改变选中cell的高度
- tableView cell 选中颜色的改变
- 动态改变tableview的cell的高度
- 点击tableview里的cell后改变cell的背景图片
- 点击选中cell后改变cell的样式
- 点击某一个cell改变单个cell的高度
- 点击cell动态改变cell高度
- [iOS]在tableview中用动画效果改变cell的高度
- 在tableview中用动画效果改变cell的高度
- tableview中用动画效果改变cell的高度
- tableview cell 选中不改变颜色
- tableView 的cell自适应高度
- tableview 自定义cell 点击cell改变cell中的label.text的字体颜色,cell复用出现问题
- tableview 自定义cell 点击cell改变cell中的label.text的字体颜色,cell复用出现问题
- tableView的cell不可点击
- 动态改变CELL 的高度
- 点击tableView的cell弹出tableView
- intent应用
- iOS运行时runtime初探(强制获取并修改私有变量,强制增加及修改私有方法等)
- 常见错误7-搭建hexo,在执行hexo deploy后,出现 error deployer not found:github的错误
- mui 内置的常用手势事件
- Git安装与配置01
- TableView 点击cell,改变选中cell的高度
- 为什么要进行烦人的单元测试?
- Windows下Git使用入门00
- 安卓开发的小技巧(1)
- web项目ant打包完整案例
- 简单GLSurfaceView 动画,透明背景的实现。
- 参数估计(Parameter Estimation):频率学派(最大似然估计MLE、最大后验估计MAP)与贝叶斯学派(贝叶斯估计BPE)
- Git与TortoiseGit基本操作03
- StatsD!次世代系统监控的核心