MTL测试结果说在IPad Pro 2018上出现了没有全屏的问题。由于是在Splash Screen阶段就出现了不全屏的现象,故认为应该这是native阶段的问题。
于是以「ipad pro 2018 unity fullscreen」为关键字进行搜索。查到一可行之方法如下:
- 进入ios Player Setting
- 找到Splash Screen项
- 将其下的IPad的选项改成default
生效的原理不详。改动此选项应该是会改动info.plist
里的选项。
在这一篇文章中有说到,欲适配IPhoneX有两步要做:
- 不使用安全区域
- 设置一张对应的闪屏图(必要)
由于该文章强调了第二步的重要性,故可推断出错误的(或缺失)闪屏图会导致无法全屏。
参考文献:
改法
I upgraded my XCode to 10.1 and still had the same behavior, but when I built an empty project it didn’t have the problem– so I went through every setting and it turned out to be caused by my Launch Screen settings in PlayerSettings. I had mine set to “None”. When I switched to “Default” my build fills the screen properly ‾_(ツ)_/‾
原理
iOS determines App’s resolution by looking for launch image with matching screen dimensions in the app asset catalog (*.xassets). If the matching one is not found, it will try to find launch images used by older generation devices for backward compatibility. The app will launch in resolution of whatever launch image is eventually found.
When launch screen options are set to default, Unity generates blank launch image for every screen dimension variant and add them to the asset catalog. The same effect can be achieved with a Storyboard file.