2
Я использовал третью партию вид расширяемой таблицы с именем «ExpandableTableView», когда я хочу, чтобы расширить конкретный один раздел с помощью пользовательской кнопки в моем view.my фрагменте кода:Как развернуть отдельный конкретный раздел?
UIView *view=Gesture.view;
isFirsTime=NO;
//NSLog(@"%ld",(long)view.tag);
for (int h=0; h<dicAll.count; h++)
{
NSString *strRegisterId=[[[dictStatndardDefectsResult valueForKey:@"defectdata:"]valueForKey:@"projectdefectid"]objectAtIndex:h];
NSString *strBtnTag=[NSString stringWithFormat:@"%ld",(long)view.tag];
if ([strRegisterId isEqualToString:strBtnTag])
{
btnIndex=h;
// NSLog(@"%ld",(long)btnIndex);
isTappedMarker=YES;
}
}
NSMutableArray *indexPaths=[[NSMutableArray alloc]init];
[indexPaths addObject:[NSIndexPath indexPathForRow:0 inSection:btnIndex]];
NSLog(@"%@",arrDefectImages);
NSLog(@"numberOfRowsInSection: %ld",(long)[self tableView:tblSupplierDefect numberOfRowsInSection:btnIndex]);
[tblSupplierDefect beginUpdates];
[self.tblSupplierDefect insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationAutomatic];
[tblSupplierDefect endUpdates];
где btnIndex это номер раздела, который я хотите расширить.