简体   繁体   中英

Background during modal view horizontal flip transition

I am using an iOS 5 storyboard-based project. When presenting a modal view controller I have selected to use the horizontal flip transition. During the transition the background is black, which is not particularly aesthetic given the design of my app. How can I change the background colour during the transition?

On non-storyboard projects I was able to change the background colour of the MainWindow.xib, but since this file is no longer present in storyboard projects this cannot be done. Additionally, as the entry point of the storyboard is a UINavigationController there doesn't seem to be any property for a background colour (I doubt that would make a difference anyway, since the background colour I need to change is associated with the window and not the main view controller, since that view controller is essentially being flipped to display the modal view controller).

Any help would be greatly appreciated.

Go to your AppDelegate and to

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

do this:

window.layer.contents = (id)[UIImage imageNamed:@"IMAGE_NAME.png"].CGImage;

or if you just want to change the color, then change the backgroundColor property of the layer.. Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM