1
由於無法描述的原因,我正在編程上將我的應用程序標籤欄更改爲不同的視圖。不幸的是,這是瞬間的,我們希望當你在導航控制器上執行pushViewController
時,你會得到正常的負載效應。在更改UITabBar的選定標籤時模仿「正常」視圖轉換
我非常缺乏經驗,在objc c中使用動畫,我嘗試使用一些代碼,我發現這裏的礦:
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:[self view] cache:YES];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:2.0];
[[[self nav] tabBarController] setSelectedIndex:2];
[UIView commitAnimations];
這確實各種各樣的動畫,導航欄神祕地從上面看來,不完全是我想要的:)
我知道這是舊的,但對於它的價值,從iOS 4.0開始,您可以使用新的UIView轉換函數。我做了一些非常相似的事情,但是在完成的動畫模塊中調用了setSelectedIndex:這個模塊效果很好。 – slycrel 2010-11-30 08:15:16