修复启动图方向:Info.plist 补顶层 UISupportedInterfaceOrientations
Xcode 26 General → Deployment Info UI 只把 orientation 写入带后缀的 INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone / _iPad,**没有** 顶层无后缀的 UISupportedInterfaceOrientations。LaunchScreen 阶段 iOS 处于 device idiom 尚未识别的早期窗口,只看顶层无后缀 key —— 缺失时 fallback 到 portrait 渲染再被旋转 90° 适配横屏设备,视觉表现是 splash 内容横躺 在中间一个竖向矩形里。 修复:在 Info.plist 显式补一份无后缀 UISupportedInterfaceOrientations = landscape。Build 后 .app 内 Info.plist 三个 key(无后缀 + ~iphone + ~ipad)齐全,LaunchScreen 正确按 landscape 渲染。 参考:原 daoqi/msext 用的也是顶层无后缀 key(iOS 9 时代写法)+ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME 自动旋转 portrait 资源;新项目 LaunchScreen.storyboard 没有自动旋转魔法,必须显式补 key。 注:开发期间改 Info.plist orientation 后 Xcode 覆盖安装不会刷 iOS launch snapshot 缓存,需长按删除 app 重装才能看到新效果;终端用户 不受影响(IPA 首次安装即按当前 Info.plist 渲染)。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
0ecfa4fb69
commit
a6433d9e95
@@ -34,5 +34,18 @@
|
|||||||
<false/>
|
<false/>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<!--
|
||||||
|
LaunchScreen 阶段(iOS 在 app 进程尚未启动、device idiom 尚未识别的早期窗口)
|
||||||
|
只看顶层 UISupportedInterfaceOrientations,不识别 ~iphone / ~ipad 后缀变体。
|
||||||
|
Xcode 26 的 General → Deployment Info UI 只会写 INFOPLIST_KEY_*_iPhone /
|
||||||
|
INFOPLIST_KEY_*_iPad 两条带后缀的 key,会导致 LaunchScreen 默认 portrait 渲染、
|
||||||
|
再被旋转 90° 适配横屏设备(视觉:splash 内容横躺)。在 Info.plist 里显式补一份
|
||||||
|
无后缀 key 修复 LaunchScreen orientation。
|
||||||
|
-->
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
Reference in New Issue
Block a user