Expandable TableView Animation
點擊列表某一行(cell),被點擊的列表行下拉展開,新展開的視圖(demo中是新的列表)和當前被點擊的列表行重新組成一個新的視圖。換句話說,就是從主視圖的列表到列表某一行的細節(jié)視圖的一種平滑跳轉(zhuǎn)動畫。
代碼使用方式:
step 1: copy OZLExpandableTableView.h && OZLExpandableTableView.m to your project
step 2: #import “OZLExpandableTableView.h” in your master view
step 3: in your master view, add code [self expandFromCell: toViewController:] when you trigger the detail view
for example:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
OZLDetailViewController *detailview = [[OZLDetailViewController alloc] init];
detailview.titleStr = [_data objectAtIndex:indexPath.row];
[self expandFromCell:[tableView cellForRowAtIndexPath:indexPath] toViewController:detailview];
}
step 4: add code below in your master view
-(void) viewWillAppear:(BOOL)animated
{
[self restoreFromExpandedCell];
}
