草庐IT

arrayForBool

全部标签

ios - 展开和折叠 tableView 部分

我想展开/折叠表格View部分。我用谷歌搜索并找到了一个代码并且它工作正常。但问题是打开新部分时之前打开的部分没有关闭。谢谢-(void)sectionHeaderTapped:(UITapGestureRecognizer*)gestureRecognizer{NSIndexPath*indexPath=[NSIndexPathindexPathForRow:0inSection:gestureRecognizer.view.tag];if(indexPath.row==0){BOOLcollapsed=[[arrayForBoolobjectAtIndex:indexPath.se