2013-04-05 3 views
0

저는 AirPlay를 사용하고 있습니다. iPad의 기본 컨텐츠는 AppleTV에 잘 전달됩니다.UIScreen 값을 설정 한 후 UIWindow 크기를 유지하십시오.

iPad에서 AppleTV보다 다른 정보를 원할 때 해상도 문제가 발생합니다. 내가

_atvWindow.screen = [[UIScreen screens] objectAtIndex:0]; 

NSLog가 표시 나는 아이 패드 화면으로 UIWindow를 설정

을 원하는

_atvWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 2048, 1536)]; 

NSLog 창 프레임의 크기를 나타냅니다 :

은 내가 UIWindow 인스턴스를 창 프레임은 현재 1024x768입니다.

이것은 망막 iPad입니다. 나는 크기가 망막과 그에 따른 이미지로 남아 있기를 원한다. 일단 망막 품질 이미지를 추가하면 (예상대로) 너무 크게됩니다. 이 아이디어의 원인이되는 아이디어 나 내가 여기에서 놓치고있는 아이디어는 무엇입니까?

답변

0

[알림 개체] 개체에 들어있는 화면에서 프레임 크기를 읽으려고 했습니까?

- (void)handleConnectedScreen:(UIScreen *)screen withViewController:(UIViewController *)controller { 
    if(!_airPlayWindow) 
    { 
     CGRect frame = screen.bounds; 
     _airPlayWindow = [[UIWindow alloc] initWithFrame:frame]; 
     _airPlayWindow.backgroundColor = [UIColor clearColor]; 
     [_airPlayWindow setScreen:screen]; 
     _airPlayWindow.hidden = NO; 
    } 

    UIViewController *oldController = _airPlayWindow.rootViewController; 
    [_airPlayWindow setRootViewController:controller]; 
    [oldController removeFromParentViewController]; 
} 


- (void)screenDidConnect:(NSNotification *)notification { 
    ABOutputViewController *c = [[ABOutputViewController alloc] init]; 
    [self handleConnectedScreen:[notification object] withViewController:c]; 
} 


[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidConnect:) name:UIScreenDidConnectNotification object:nil];