2012-07-22 33 views
0

我很好奇如何實現以下應用動畫:enter image description here可可:如何實現表格動畫?

我點擊阿爾西德斯後,該應用將逐漸顯示在右邊和左邊表格的寬度將原來的1/2的新觀點。
enter image description here

如果我想實現它,我該怎麼辦?我應該使用什麼數據結構和動畫?

回答

2

大多數自定義動畫的答案是想想你想做什麼和做什麼。 Trite但是真的。

  1. 剪斷的tableview的一半動畫速度X寬

  2. 移動RH細節表中右的動畫速度X

你需要有你的ViewController作爲這對錶的容器。但是桌面視圖可能有自己的視圖控制器,集裝箱經理應該強烈參考它。

ManagerViewController -> UIView -> PeopleTableView -> PeopleTableViewController 
           -> DetailTableView -> DetailTableViewController 

因此,在代碼...

detailTableView.frame = Frame_with_x_aligned_to_RH_edge_of_screen; 

[UIView animateWithDuration:X 
    animations:^{ 
     peopleTableView.frame = Frame_with_half_its_fully_expanded_width; 
     detailTableView.frame = Frame_with_x_aligned_to_edge_of_peopleTable; 
} 
    completion:^{ //stuff to do at the end of the animation 
}]; 
+0

太感謝你了,我來試試 – NOrder 2012-07-22 10:38:48