My app displays a separate external screen with standard code below. I've recently found that running on a non-retina device (iPad mini or iPad2) causes the display to only fill the top left quarter of the external screen. Display fills the external screeen as expected when running on a retina device.
I see the externalScreen.scale is 2 on a non-retina device and the bounds of the externalScreen are only half of the desired mode size. I tried to compensate with the check for scale == 2 in the code below. But this doesn't work.
Anyone know how to handle filling the external screen with a non-retina device?
- (void)AddTvOutView
{
if ([[UIScreen screens] count] > 1)
{
externalScreen = [[UIScreen screens] objectAtIndex:1];
CGRect screenBounds = externalScreen.bounds;
if (externalScreen.scale ==2) // this doesn't work
{
NSLog(@"externalscreen scale is 2 so try making everything bigger");
screenBounds = CGRectMake (screenBounds.origin.x, screenBounds.origin.y , screenBounds.size.width * externalScreen.scale ,screenBounds.size.height * externalScreen.scale );
}
externalWindow = [[UIWindow alloc] initWithFrame:screenBounds];
externalWindow.screen = externalScreen;
externalView = [[UIView alloc]initWithFrame:screenBounds ];
... put content in externalView
[externalWindow addSubview:externalView];
[externalWindow makeKeyAndVisible];
}