ios 自定义折叠控件 ——UITableView
来源:互联网 发布:武汉哪里有学电子网络 编辑:程序博客网 时间:2024/05/16 04:22
方式一:
1 原理
打开:
[self.stateArrayaddObjectsFromArray:@[@"ViewCell0"]];
[self.stateArrayaddObjectsFromArray:@[@"ViewCell0"]];
[_tableView beginUpdates];
[_tableView insertRowsAtIndexPaths:@[path,path2]withRowAnimation:nil];
[_tableView endUpdates];
关闭:
[self.stateArray removeAllObjects];
[_tableView beginUpdates];
[_tableView deleteRowsAtIndexPaths:@[path,path2]withRowAnimation:nil];
[_tableView endUpdates];
在 section Header上触发
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
HeaderView * header = [[HeaderView alloc]initWithFrame:CGRectMake(0,0,self.view.frame.size.width,40)];
HeaderButton * btn = [HeaderButton buttonWithType:UIButtonTypeDetailDisclosure];
[btn addTarget:selfaction:@selector(btnAct:)forControlEvents:UIControlEventTouchUpInside];
btn.frame =CGRectMake(180,20,20,20);
btn.tag = section;
btn.canOpen =1;
btn.isOpen =1;
header.backgroundColor = [UIColoryellowColor];
HeaderView * header2 = [[HeaderViewalloc]initWithFrame:CGRectMake(0,0,self.view.frame.size.width,20)];
header2.backgroundColor = [UIColorgreenColor];
[header addSubview:header2];
[header addSubview:btn];
return header;
}
方式二:
代码Demo
方式 1:http://download.csdn.net/detail/bravegogo/9636715
方式 2:
- ios 自定义折叠控件 ——UITableView
- 自定义UITableView折叠效果
- 自定义UITableView折叠效果
- iOS开发--自定义列表控件(UITableView)
- iOS控件——UITableView详解
- 黑马程序员—IOS控件UITableView详解
- [安卓自定义控件]自定义组合控件——支持根据TextView行数展开折叠的引文显示控件ExpandableReferenceView
- iOS学习笔记—— UItableView 控件的简单使用
- iOS开发UI篇—UITableview控件简单介绍
- iOS开发UI篇—UITableview控件基本使用
- iOS开发UI篇—UITableview控件使用小结
- iOS开发UI篇—UITableview控件简单介绍
- iOS开发UI基础—18UITableview控件简单介绍
- iOS开发UI基础—19UITableview控件基本使用
- iOS开发UI基础—25UITableview控件使用小结
- iOS开发UI篇—UITableview控件简单介绍
- iOS开发UI篇—UITableview控件基本使用
- iOS开发UI篇—实现UItableview控件数据刷新
- Xamarin.Android Build Error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$
- Android 70道面试题汇总不再愁面试
- [Leetcode] Search for a Range
- 天池阿里音乐流行趋势预测大赛--初赛
- 项目三-体验复杂度(1)两种排序算法的运算时间
- ios 自定义折叠控件 ——UITableView
- android启动activity报android.content.res.Resources$NotFoundException: String resource ID #x12
- 【转载】 Intellj idea 如何设置类头注释和方法注释
- 刷新页面随机改变某段落的文字(js代码)
- dispatchTouchEvent()、onInterceptTouchEvent()和onTouchEvent()的关联 (一)
- 第四周 项目2-长方形面积
- Verilog语法_4(Modelsim自动化仿真)
- mac装win10后快捷键失灵
- ASCII码对照表