0

因此,我創建了一個iPad應用程序,它在UITableView中顯示圖像,當選中某行/圖像時,它將推動另一個視圖控制器以全屏模式播放視頻。這一切都正常工作,但我想動畫從表中圖像的原始大小過渡到全屏視頻。這裏的視頻顯示http://www.apple.com/ipad/videos/#itunes約1秒鐘我想要的。那麼如何獲得所選單元格的框架呢?我將如何將視圖從單元格過渡到全屏?iPad動畫模式視圖控制器從表單元格

這裏是我怎麼現在做的過渡:

- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath 
{ 
    if (indexPath.row == 0) 
    { 
     VideoViewController * video1 = [[VideoViewController alloc] init]; 
     UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:video1]; 
     navController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; 
     navController.modalPresentationStyle = UIModalPresentationFullScreen; 
     navController.navigationBarHidden = YES; 

     [self presentModalViewController:navController animated:YES]; 
    } 
} 

回答

0

有一個叫UAModalPanel一個開源項目,它做了非常smiler到你想要達到的目的。您需要通過調用UITableView的方法來獲得你的觀點:

- (UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath 

然後,你需要到小區的中心點轉換爲上海華用座標平面:

- (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view; 

然後你就可以通過這個中心指向面板從那裏顯示。




全面披露:我是這個項目的維護者。

+0

非常感謝! – Sean 2012-07-05 18:45:11

相關問題