HI allí,Usando UIScreen para manejar una pantalla VGA, ¿no parece mostrar la ventana UI?
Estoy tratando de usar UIScreen para conducir una pantalla separada con el dongle VGA en mi iPad.
Esto es lo que tengo en mi viewDidLoad raíz del controlador de vista:
//Code to detect if an external display is connected to the iPad.
NSLog(@"Number of screens: %d", [[UIScreen screens]count]);
//Now, if there's an external screen, we need to find its modes, itereate through them and find the highest one. Once we have that mode, break out, and set the UIWindow.
if([[UIScreen screens]count] > 1) //if there are more than 1 screens connected to the device
{
CGSize max;
UIScreenMode *maxScreenMode;
for(int i = 0; i < [[[[UIScreen screens] objectAtIndex:1] availableModes]count]; i++)
{
UIScreenMode *current = [[[[UIScreen screens]objectAtIndex:1]availableModes]objectAtIndex:i];
if(current.size.width > max.width);
{
max = current.size;
maxScreenMode = current;
}
}
//Now we have the highest mode. Turn the external display to use that mode.
UIScreen *external = [[UIScreen screens] objectAtIndex:1];
external.currentMode = maxScreenMode;
//Boom! Now the external display is set to the proper mode. We need to now set the screen of a new UIWindow to the external screen
external_disp = [externalDisplay alloc];
external_disp.drawImage = drawViewController.drawImage;
UIWindow *newwindow = [UIWindow alloc];
[newwindow addSubview:external_disp.view];
newwindow.screen = external;
}
¿Qué tiene el iPad específico sobre esto? ¿Puedes hacer una salida a una pantalla externa en iPhone también? – Ali