2013-04-04 75 views
2

在UIView子類(MAINVIEW)我這樣做:UIView的過渡 - 翻轉兩個子視圖

[UIView transitionFromView:firstView 
         toView:secondView 
         duration:3 
         options:UIViewAnimationOptionTransitionFlipFromTop | UIViewAnimationCurveEaseIn | UIViewAnimationOptionShowHideTransitionViews 
        completion:^(BOOL finished) 
    { 

    } 
    ]; 

然而,整個視圖翻轉。我只想翻轉firstView和secondView,它們是mainView的子視圖。我該如何解決?

+0

找到了答案[這裏] [1]。子視圖需要一個容器視圖。 [1]:http://stackoverflow.com/questions/9524048/how-to-flip-an-individual-uiview-without-flipping-the-parent-view?rq=1 – soleil 2013-04-04 23:08:57

回答

0

試試這個

options:UIViewAnimationOptionTransitionFlipFromTop 
completion:NULL 
+0

你可以提供完整的聲明?這隻看起來像方法調用 – 2013-04-05 07:19:00

+0

[UIView transitionFromView:oldView toView:newView duration:1.0 options:UIViewAnimationOptionTransitionFlipFromLeft completion:NULL]的兩個選項; – dhaya 2013-04-05 10:43:02