presentViewControllerã§å ã®ç»é¢ãè¦ããããã«ããã®ããã¾ããããªã
iPhoneã®ãã¼ãã¼ãã表示ãããããã«ãèªåã®ä½ã£ãViewControllerã表示ããããã¤ã§ãã
ViewControllerãä½æãããã®ViewControllerã®Viewã®BackgroundãClearColorã«ãã¦presentViewControllerããã°è¡ããâ¦ã¨æã£ãã®ã§ããããã©ã³ã¸ã·ã§ã³ä¸ã¯éãã¦è¦ããã®ã«åãæ¿ãã£ãã¨ããã«ç»é¢ãæ¶ãã¦ãã¾ãã¾ãã
https://developer.apple.com/jp/devcenter/ios/library/documentation/ViewControllerPGforiOS.pdf:title=iOS ViewController ããã°ã©ãã³ã°ã¬ã¤ã]ãè¦ãã¨ã
View Controllerã表示ãããéãiOSã¯è¡¨ç¤ºã³ã³ããã¹ããæ¤ç´¢ãã¾ããæ¤ç´¢ã®æåã®å¯¾è±¡ã¯ã表示ã ãå´ã®View Controllerã§ããã®definesPresentationContextããããã£ãåç §ãã¾ãããã®ããã ãã£å¤ãYESã§ããã°ã表示ããå´ã®View Controllerã«è¡¨ç¤ºã³ã³ããã¹ããå®ç¾©ããã¦ãã¾ãããã㧠ãªããã°ãView Controlleré層ãä¸ã«åãã£ã¦é 次ãã©ããYESãè¿ãView Controllerãè¦ã¤ãããã ã¦ã¤ã³ãã¦ã®ã«ã¼ãView Controllerã«å°éããã¾ã§ç¶ãã¾ãã
ããView Controllerã表示ã³ã³ããã¹ããå®ç¾©ããå ´åãããã¯è¡¨ç¤ºã¹ã¿ã¤ã«ãå®ç¾©ãã¾ããé常ã 表示ãããå´ã®View Controllerã¯ãmodalTransitionStyleããããã£ã§è¡¨ç¤ºå½¢æ ãå¤æãã¾ãã definesPresentationContextãYESã§ããView Controllerã¯ã providesPresentationContextTransitionStyleãYESã¨ãããã¨ãã§ãã¾ãã providesPresentationContextTransitionStyleãYESã§ããã°ãiOSã¯è¡¨ç¤ºã³ã³ããã¹ãã® modalPresentationStyleã調ã¹ã¦ãæ°ããView Controllerãã©ã®ããã«è¡¨ç¤ºãããå¤æãã¾ãã
ã¨ãªã£ã¦ãã®ã§ãé·ç§»å ã®ViewControllerã§
self.definesPresentationContext = YES; self.providesPresentationContextTransitionStyle = YES; self.modalPresentationStyle = UIModalPresentationCurrentContext; [self presentViewController:vc animated:YES completion:nil];
ã¨ããã°ã¡ããã¨ééãã¦ããããâ¦ãªã®ã§ãããæ®å¿µãªããããã¯ãã¾ãè¡ãã¾ããã§ããã
è²ã ã¯ã¾ã£ãããããçµå±ã°ã¼ã°ã«å çä¸æ¼ãã® http://stackoverflow.com/questions/12736394/uimodalpresentationcurrentcontext-with-transition ã«çããæãã¾ãããæ¥æ¬èªã®æ å ±ãåªå ãã¦è¦ã¦ãã®ãæå ã§ããâ¦
was able to accomplish this by setting modalPresentationStyle = UIModalPresentationCurrentContext on the rootViewController of my UIWindow, IF I haven't presented any new full screen viewControllers on top of this rootViewController. I did something like this:
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController; rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext; [self presentViewController:vc animated:YES completion:nil];
rootViewControllerãæ¾ãã¦ãããªãããã§ããããã¤ã®modalPresentationStyleãå¤ãã¦ãã£ã¦ã¿ãããã¾ããã¨è¡ãã¾ããã
ãã ããã®æ¹æ³ã ã¨ãã¾ããã©ã³ã¸ã·ã§ã³ãããããªãããã§ãããã
ãã¼ããããä¸æ¯ã
[ããå°ã調æ»ãå¿ è¦ããã§ãã