gpt4 book ai didi

ios - 在 iOS 的外部显示器上显示全屏

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:20:09 30 4
gpt4 key购买 nike

我只想在外接显示器上全屏显示。

我正在使用这样的代码:

- (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)。但它不起作用。

提前致谢

最佳答案

改变这一行:

screen.overscanCompensation = UIScreenOverscanCompensationInsetBounds;

screen.overscanCompensation = 3;

这是一个未记录的值...

关于ios - 在 iOS 的外部显示器上显示全屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9174288/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com