[英]tvos: How should we handle low resolution monitor? like 1366x768
Original question is: tvos: Why is full screen UIView actually beyond visual bounds of the main screen on real TV monitor? 原始问题是:tvos:为什么全屏UIView实际上超出了真实电视监视器上主屏幕的可视范围?
On tvos, the root UIView size is 1920x1080 by default on storyboard, which is full screen I believe. 在tvos上,故事板上的默认UIView根大小默认为1920x1080,我认为这是全屏显示。 My issue is when I run it on tvos simulator, I see it perfectly shown in full screen, but when I run it on real apple TV device with a HD monitor connected, I see the UIView is beyond the visual bounds of the monitor screen on all 4 edges, with margin =~ 44px
我的问题是,当我在tvos模拟器上运行它时,我可以看到它在全屏模式下完美显示,但是当我在连接了高清显示器的真实Apple TV设备上运行它时,我看到UIView超出了显示器屏幕的视觉范围所有4条边,边距=〜44px
I have to move subview contents towards center to make all of them fully appear on TV monitor. 我必须将子视图的内容移到中心,以使它们全部完全显示在电视监视器上。
I suspect this might be a monitor adaptability issue, but I tried this on 3 HD TV monitors (1080p), they all show the same problem. 我怀疑这可能是显示器的适应性问题,但是我在3台高清电视显示器(1080p)上进行了尝试,它们都显示相同的问题。
Does anyone see this issue? 有人看到这个问题吗? Thanks in advance.
提前致谢。
EDIT: 编辑:
I just checked the local resolution of all the 3 monitors and found it is actually only 1366x768, much smaller than tvos's 1920x1080 This made me even more confused that there should be a whole lot of portion of the UIView being outside of the low resolution monitor: 277px on left/right edge, but actually it is only about 44px. 我只是检查了所有3台显示器的本地分辨率,发现它实际上只有1366x768,比tvos的1920x1080小得多。这让我更加困惑的是,UIView的大部分应该在低分辨率显示器之外:左右边缘为277像素,但实际上只有44像素左右。
I tried UIView's different modes as well, Scale to Fill, Aspect Fit, Center... all same!! 我也尝试了UIView的不同模式,“缩放至填充”,“宽高比调整”,“居中...”都一样!!
And, I notice tvos native views like home screen, movies screens, app store screens, they all perfectly fit my low resolution monitors. 而且,我注意到tvos的本机视图,例如主屏幕,电影屏幕,应用商店屏幕,它们都非常适合我的低分辨率显示器。
Please help, how should I deal with this issue? 请帮助,该如何处理?
BTW, does apple tv / tvos has the ability to detect monitor's native resolution? 顺便说一句,苹果电视/ TVOS是否有能力检测显示器的本机分辨率?
在使用电视显示器玩了一段时间之后,我发现大多数显示器都具有显示模式功能供用户选择,例如16:9电影/游戏/计算机/等,当我选择计算机时,我会看到完整显示的tvos应用程序屏幕完美。
I also have this issue. 我也有这个问题。 What I did is to just make my UIView adjusts it's bounds x+=50, y+=30, then the width-=100, height-=60.. subtract width and height with *2 of x and y... hope this helps..
我所做的只是让我的UIView调整了边界x + = 50,y + = 30,然后是width- = 100,height- = 60 ..用x和y的* 2减去宽度和高度...希望这会有所帮助..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.