0

이 질문은 이전에 제기되었지만 수용된 해결책이 내 문제를 해결하지 못하는 것입니다. 그래서 나는 눈의 또 다른 세트가 내가하고있는 것을 잡아 줄 것을 희망합니다. 잘못된. 사용자가 이전보기 컨트롤러의 내용을 볼 수 있도록 배경이 어둡고 반투명 한 2 차 탐색 컨트롤러를 제공하려고합니다.탐색 컨트롤러 아래의보기 컨트롤러에서 내용을 볼 수 없음

-(void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    RootViewController *rvc = [[UIStoryboard storyboardWithName:@"RootView" bundle:nil] instantiateViewControllerWithIdentifier:@"RootViewRVC"]; 
    self.nvc = [[UINavigationController alloc] initWithRootViewController:rvc]; 
    self.nvc.modalPresentationStyle = UIModalPresentationOverCurrentContext;  
    [self presentViewController:self.nvc animated:YES completion:nil]; 
} 

위의 코드는이 산출 :

enter image description here

앱이 현재 탐색 컨트롤러와 rootviewcontroller와 대한 스토리 보드를 사용

내가 달성하기 위해 노력하고있어 표시 : 여기 코드는

enter image description here

TableViewController는 rootvi와 관련된 속성입니다 두 이미지 모두 ewcontroller (코드는 동일한 스토리 보드를 사용함). 네비게이션 컨트롤러 스토리 보드에서 Xcode 8의 속성 관리자는 "프레젠테이션"을 "현재 화면 컨텍스트"로 설정하고 ("전체 화면 오버"도 작동 함) 트릭을 수행하는 것처럼 보이지만 프로그래밍 방식으로 그렇게하는 것을 선호하지 않습니다 스토리 보드를 사용하십시오.

+0

[모달 발표의 ViewController 투명 배경]의 사용 가능한 복제 (http://stackoverflow.com/questions/27669699/transparent-background-for-modally-presented-viewcontroller) – dmorrow

+0

그래, 나는 그 질문을 보았다. 그러나 무엇인가의 이유로, 받아 들여진 해결책은 나를 위해 작동하지 않았다. – Vee

+0

definePresentationContext를 YES로 설정하십시오. http://stackoverflow.com/a/26891602/5184217 –

답변

0

이 작동 할 수 있습니다

-(void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    RootViewController *rvc = [[UIStoryboard storyboardWithName:@"RootView" bundle:nil] instantiateViewControllerWithIdentifier:@"RootViewRVC"]; 
    rvc.modalPresentationStyle = UIModalPresentationOverCurrentContext; 
    self.nvc = [[UINavigationController alloc] initWithRootViewController:rvc];  
    [self.nvc.view setBackgroundColor:[UIColor colorWithRed:1.0 green:0 blue:0 alpha:0.5]]; 
    [self presentViewController:self.nvc animated:YES completion:nil]; 
} 
관련 문제