2014-06-11 3 views

답변

3

이 해결 방법은 xcode6_beta7에서 필요합니다. 최신 xcode6 에는 UIModalPresentationOver * 스타일이 고정되어 있습니다. 그래서, 그냥 myModalViewController.modalPresentationStyle에 할당하고 있습니다. 이제는 괜찮습니다.

가 마지막으로 UIPresentationController helpthis post

appDelegate.window.rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext; 
MyModalController *myModalController = [[MyModalController alloc] initWithNibName:@"MyModalController" bundle:nil]; 

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myModalController]; 
navController.modalPresentationStyle = UIModalPresentationCustom; 
navController.transitioningDelegate = myModalController; 

[self.navigationController presentViewController:navController animated:YES completion:nil]; 

당신은 모달 뷰 컨트롤러를 만들 수 있습니다 읽은 후에는 아이폰 OS 8 일 만든

@interface MyModalController : UIViewController <UIViewControllerTransitioningDelegate> 

UIViewControllerTransitioningDelegate

에서 상속 presentationControllerForPresentedViewController를 오버라이드 (override) : ...

-(UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source 
{ 
    if (presented == self) { 
     return [[TransparentPresentationController alloc] initWithPresentedViewController:presented presentingViewController:presenting]; 
    } else { 
     return nil; 
    } 
} 

코드 아래, 내 대답은 더 간단하다 shouldRemovePresentersView

- (BOOL) shouldRemovePresentersView { 
    return NO; 
} 
+0

I 다른 sence이 쓰기 – SuperHappy

+0

나는 두 개의 장면이 쓰기의 ViewController에서 - (IBAction를) 본 (ID) 송신기 { // 장면 두 SecondViewController * 제어기 = [SecondViewController의 ALLOC] init]; [컨트롤러 존재]; } 다음과 같은 경우 :-(void) present { UIViewController * root = [[[UIApplication sharedApplication] delegate] window] rootViewController]; [self setTransitioningDelegate : self.transitionController]; self.modalPresentationStyle = UIModalPresentationCustom; [root presentViewController : 자체 애니메이션 : 예 완료 : 없음]; } 그러나 위임 방법을 사용하지 않았습니다. 왜 그렇습니까? – SuperHappy

+0

그것은 작동합니다. 대단히 감사합니다! – echo

13

을 UIPresentationController

에서
@interface TransparentPresentationController : UIPresentationController 

을 상속 무시 TransparentPresentationController의 인스턴스를 반환. 이것은 iOS8 (XCode6 GM 시드)에서 작동합니다.

HogeViewController *vc = [[HogeViewController alloc] init]; 
vc.modalPresentationStyle = UIModalPresentationOverFullScreen; 
[self presentViewController:vc animated:NO completion:nil]; 
+1

을 반환합니다. 내 애플 리케이션에서 회전 할 때 메서드 - (BOOL) shouldAutorotate { return NO; } – SuperHappy

+0

약 6 개의 솔루션을 읽었습니다 ... 아무도 작동하지 않았지만이. 큰 포옹 – braden

+0

나는 내 인생에 빚이있다 –