我只想在外接显示器上全屏显示。
我正在使用这样的代码:
- (void) startTvOut {
NSArray *screens = [UIScreen screens];
CGSize max;
max.width = 0;
max.height = 0;
UIScreenMode *maxScreenMode = nil;
for (UIScreen *screen in screens)
{
if (screen != [UIScreen mainScreen])
{
for(int i = 0; i < [[screen availableModes] count]; i++)
{
UIScreenMode *current = [[screen availableModes] objectAtIndex: i];
if (current.size.width > max.width)
{
max = current.size;
maxScreenMode = current;
}
}
if (exWindow == nil)
{
exWindow = [[HUWindow alloc] initWithFrame:screen.brounds];
exWindow.backgroundColor = [UIColor whiteColor];
}
screen.overscanCompensation = UIScreenOverscanCompensationInsetBounds;
screen.currentMode = screen.preferredMode;
exWindow.screen = screen;
[exWindow makeKeyAndVisible];
m_isStarted = YES;
}
}
}
它无法在外部设备上显示全屏。
在我将代码更改为之后
screen.overscanCompensation = UIScreenOverscanCompensationInsetBounds;
,
screen.overscanCompensation = UIScreenOverscanCompensationInsetApplicationFrame;
它可以显示全屏,但点 (0,0) 不在左屏幕的顶部。
我的目标是全屏显示屏幕,并在屏幕的左上角有点 (0, 0)。但它不起作用。
提前致谢