日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

setAnimationTransition:forView:cache: 运行动画时背景色问题

發(fā)布時間:2025/7/14 编程问答 55 豆豆
生活随笔 收集整理的這篇文章主要介紹了 setAnimationTransition:forView:cache: 运行动画时背景色问题 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

首先我描寫敘述一下問題:當(dāng)我從一個view到另外一個view的時候?

解答:這個問題的解決還須要看setAnimationTransition:forView:cache: 官方Api,官方是這樣說的:

1.Begin an animation block.
2.Set the transition on the container view.
3.Remove the subview from the container view.
4.Add the new subview to the container view.
5.Commit the animation block.

1.開始一個動畫塊。

2.在容器視圖中設(shè)置轉(zhuǎn)換。 3.在容器視圖中移除子視圖。 4.在容器視圖中加入子視圖。 5.結(jié)束動畫塊。

就是他全部的操作都是在父View上進(jìn)行操作的。我的代碼是這樣寫得:

AppDelegate * delegate = [UIApplication sharedApplication].delegate;delegate.nav_Center.view.backgroundColor = [UIColor clearColor];//[delegate.window setBackgroundColor:[UIColor whiteColor]];[self.navigationController.view superview].backgroundColor = [UIColor whiteColor];for (UIViewController * c in delegate.nav_Center.viewControllers) {if([c isKindOfClass:[TrendViewController class]]) {if (curve>=0) {[UIView beginAnimations: @"PopNav" context: nil];[UIView setAnimationCurve: curve];[UIView setAnimationDuration:0.75];[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];NSLog(@"===%@=%@",[[self.navigationController.view superview] class],[self.navigationController.view class]);[self.navigationController popViewControllerAnimated:NO];[UIView commitAnimations];}else {[self.navigationController popViewControllerAnimated:YES];}return YES;}}
直接設(shè)置要切換到view的父view的背景色就ok了。

當(dāng)然了,有時候他的父view也可能是window。

詳細(xì)情況詳細(xì)分析吧。

希望能幫助一些人。


總結(jié)

以上是生活随笔為你收集整理的setAnimationTransition:forView:cache: 运行动画时背景色问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。