前言
- 在暑期学习完成3Gshare的时候有一个界面需要使用折叠cell,在这里把那部分的折叠cell详细解释一下
3Gshare的引入

- 如图所示,点开展示折叠cell的内容,收起展示点击的选项即可
思路
- 上面展示的是把展开button和收起button做成cell放上去,这里做成imageButton。
- 设置一个存放内容的数组
arrayCell
,设置一个tableView
,一个按钮ButtonChange
,一个当前CellcellCure
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) UIButton *ButtonChange;
@property (nonatomic, strong) NSMutableArray *arrayCell;
@property (nonatomic, strong) UITableViewCell *cellCure;
- 点击ButtonChange
-
- 改变tableView的宽度,并且改变图标(记得更新数据)
- (void)pressButton :(UIButton*) button{
if (_ButtonChange.tag == 1) {
_tableView.frame = CGRectMake(230, 180, 120, 120);
[_ButtonChange setImage:[UIImage imageNamed:@"buttonno.png"] forState:UIControlStateNormal];
_ButtonChange.tag = 2;
[_tableView reloadData];
} else {
_tableView.frame = CGRectMake(230, 180, 120, 35);
[_ButtonChange setImage:[UIImage imageNamed:@"buttonyes.png"] forState:UIControlStateNormal];
_ButtonChange.tag = 1;
[_tableView reloadData];
}
}
- 点击当前cell改变内容

