2011-01-06 101 views
0

滑動時,我有一個UINavigationController其滑動的UIView在從屏幕的底部,當用戶按下按鈕。毛刺在UIView的與kCATransitionMoveIn

緊接着我設置視圖的「隱藏」屬性爲NO,不過,的UINavigationController的觀點有時完全出現在地方一幀,彷彿動畫片結束了。

這是顯示/代碼隱藏視圖:添加層時

- (void)showGUI: (bool)show 
{ 
CATransition *transition = [CATransition animation]; 
transition.duration = 0.5; 
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 

if (!show) 
{ 
    transition.type = kCATransitionReveal; 
    transition.subtype = kCATransitionFromBottom; 
} 
else 
{ 
    transition.type = kCATransitionMoveIn; 
    transition.subtype = kCATransitionFromTop; 
} 

[navController.view.superview.layer addAnimation:transition forKey:nil]; 

navController.view.hidden = !show; 
} 

回答

2

CATransition動畫被施加/從你動畫添加到層中除去。如果切換隱藏的屬性不起作用,請嘗試刪除視圖。

+0

這不是真的。 – zrxq 2012-12-25 16:18:30