UITableView 的操作
来源:互联网 发布:交换机镜像端口抓包 编辑:程序博客网 时间:2024/05/20 22:02
UITableView的row 和Section删除
当section下面有多行row时
// 1. 更新数据 KHModel_CartHeader *mo_header = dataSource[indexpath.section]; [mo_header.model.goodsArray removeObjectAtIndex:indexpath.row]; // 2.更新UI [tableview deleteRowsAtIndexPaths:@[indexpath] withRowAnimation:UITableViewRowAnimationAutomatic];
当section下面仅有且只有一行row时
[dataSource removeObjectAtIndex:indexpath.section]; [tableview deleteSections:[NSIndexSet indexSetWithIndex:indexpath.section] withRowAnimation:UITableViewRowAnimationAutomatic];
TableView的展示
Group:section headerView 随着cell移动而移动如图所示:sectionHeaderView是自定义的,第二个sectionHeaderView上面有一个灰色的长条,那是第一个Section Footer。
现在我需要去掉那块灰色,OK直接上代码:
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ KHUITVHeader_Cart *view = [tableView dequeueReusableHeaderFooterViewWithIdentifier:@"header"]; KHModel_CartHeader *mo = [dataSource objectAtIndex:section]; view.object = mo; typeof (self)weakSelf = self; view.block_itemSelected = ^(id obj) { [weakSelf setForHeaderGoodsSelected:((UIButton *)obj).selected model:mo]; }; return view;}- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ return 50+0.01;}-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ return 0.01;}
题外话:这篇文章那个gif使用Giphy Capture这个软件录的,下载地址:https://itunes.apple.com/cn/app/giphy-capture.-the-gif-maker/id668208984?mt=12
0 0
- UITableView中行的操作
- UITableView中行的操作
- UITableView 中行的操作
- UITableView的一些操作
- UITableView 的操作
- UITableView的编辑操作
- UITableView的移动、删除操作
- IOS UITableView中行的操作
- IOS UITableView中行的操作
- IOS UITableView中行的操作
- IOS UITableView中行的操作
- IOS UITableView中行的操作
- IOS UITableView中行的操作
- IOS UITableView中行的操作
- ios UITableView中行的操作
- UITableView的常用编辑操作
- iOS开发:UITableView中行的操作
- ios UITableView中Cell的操作
- 0.ring0-更改dbgport地址偏移过掉dbgport清0
- leetcode 95. Unique Binary Search Trees II-分治算法|动态规划|卡特兰数
- 二维数组名与地址的对应
- Javascript笔记——Javascript的基本数据类型
- Java练习: 数列/级数求和
- UITableView 的操作
- android4.4系统源码编译(四)_问题总结
- hdu 1852(积性函数)
- int (*a)[10] 和 int *a[10]
- REST--深入浅出REST
- Android平台访问https 双向认证(下)
- U盘装系统进不去pe界面
- 对Handler,Looper,messagequeue,HandlerThread的深入理解,Handler常见面试题
- ViewState的用法