1
주보기 컨트롤러가 있으며 다음보기를 표시하고 해당보기를 닫으려면 다음 코드를 사용합니다. 외부 모니터가 연결되어 있지 않으면 완벽하게 작동합니다. 첨부되어있는 경우 해당보기 컨트롤러를 제공 할 수는 있지만 이미보기 컨트롤러를 닫을 수는 없습니다. 어떻게해야합니까?모니터가 연결된 경우 dismissViewControllerAnimated가 작동하지 않았습니다.
[[[[UIApplication sharedApplication] keyWindow] rootViewController] presentModalViewController:navController animated:YES];
[[[[UIApplication sharedApplication] keyWindow] rootViewController] dismissViewControllerAnimated:YES completion:NULL];
외부 모니터보기 용입니다.
externalDisplayHandler = [[ExternalDisplayHandler alloc] init];
externalDisplayHandler.delegate = self;
if(externalDisplayHandler.monitorExists)
{
//other code
NSLog(@"externalDisplayHandler.monitorExists");
[externalDisplayHandler.contentView addSubview:viewOnMonitor];
NSLog(@"TV is attached");
}