通过点击sectionView实现section下属的cell关闭或打开,类似QQ联系人界面的功能。
#import "ViewController.h"
#define ALLWIDTH [UIScreen mainScreen].bounds.size.width
#define ALLHEIGHT [UIScreen mainScreen].bounds.size.height
@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>
{
UITableView*tableview;
NSArray *dataArr;
NSMutableArray *isOpenArr;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
tableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 40, ALLWIDTH, ALLHEIGHT-40)];
tableview.delegate =self;
tableview.dataSource = self;
tableview.tableFooterView = [[UIView alloc]init];
[self.view addSubview:tableview];
dataArr = [NSArray array];
dataArr = @[@"cell1",@"cell2",@"cell3",@"cell4",@"cell5"];
isOpenArr = [NSMutableAr