airplay - Keep UIWindow size after setting it's UIScreen value -


i'm using airplay, primary content of ipad beamed appletv fine.

when want different information on ipad on appletv, i'm getting resolution issues.

i instantiate uiwindow:

_atvwindow = [[uiwindow alloc] initwithframe:cgrectmake(0, 0, 2048, 1536)]; 

nslog indicates window frame size want

i set uiwindow ipad screen

_atvwindow.screen = [[uiscreen screens] objectatindex:0]; 

nslog indicates window frame 1024x768

it's retina ipad. want size remain retina , set images accordingly. once add retina quality images (as you'd expect) way big. ideas what's causing or missing here?

have tried read frame size screen comes in [notification object] object?

- (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]; 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -