//鎖定豎屏
plus.screen.lockOrientation("portrait-primary")
// #endif
首先準備啟動圖兩個
dc_launchscreen_portrait_background@2x.png(750*1624)
dc_launchscreen_portrait_background@3x.png(1125*2436)
LaunchScreen.storyboard文件內容如下
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234"targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES"useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"><device id="retina6_5" orientation="portrait" appearance="light" /><dependencies><deployment identifier="iOS" /><plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685" /><capability name="Safe area layout guides" minToolsVersion="9.0" /><capability name="System colors in document resources" minToolsVersion="11.0" /></dependencies><scenes><!--View Controller--><scene sceneID="EHf-IW-A2E"><objects><viewController id="01J-lp-oVM" sceneMemberID="viewController"><view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"><rect key="frame" x="0.0" y="0.0" width="414" height="896" /><autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" /><subviews><!-- 全屏背景圖 --><imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill"image="dc_launchscreen_portrait_background.png"translatesAutoresizingMaskIntoConstraints="NO" id="Tt8-jS-2H5"></imageView><!-- App 圖標 --><imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit"image="dc_launchscreen_icon.png" translatesAutoresizingMaskIntoConstraints="NO"id="vp6-uo-KS2"></imageView></subviews><!-- Safe Area --><viewLayoutGuide key="safeArea" id="IW3-oA-Ytg" /><!-- 背景透明(避免閃白) --><color key="backgroundColor" red="0" green="0" blue="0" alpha="0" colorSpace="custom"customColorSpace="sRGB" /><!-- 約束 --><constraints><!-- 背景圖:四邊貼滿父視圖(關鍵!不要對齊 Safe Area) --><constraint firstItem="Tt8-jS-2H5" firstAttribute="top" secondItem="Ze5-6b-2t3"secondAttribute="top" id="FH7-NM-QY8" /><constraint firstItem="Tt8-jS-2H5" firstAttribute="leading" secondItem="Ze5-6b-2t3"secondAttribute="leading" id="fnt-hE-VMi" /><constraint firstItem="Tt8-jS-2H5" firstAttribute="trailing" secondItem="Ze5-6b-2t3"secondAttribute="trailing" id="QGW-bk-xBw" /><constraint firstItem="Tt8-jS-2H5" firstAttribute="bottom" secondItem="Ze5-6b-2t3"secondAttribute="bottom" id="seh-wj-zPF" /><!-- App 圖標居中 --><constraint firstItem="vp6-uo-KS2" firstAttribute="centerX" secondItem="Ze5-6b-2t3"secondAttribute="centerX" id="GM5-vc-qeO" /><constraint firstItem="vp6-uo-KS2" firstAttribute="centerY" secondItem="Ze5-6b-2t3"secondAttribute="centerY" id="Qji-wc-LLD" /><!-- 可選:限制圖標最小距離邊緣 --><constraint firstItem="vp6-uo-KS2" firstAttribute="top" relation="greaterThanOrEqual"secondItem="Ze5-6b-2t3" secondAttribute="top" constant="100" id="M4i-XX-uO2" /></constraints></view></viewController><placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder"sceneMemberID="firstResponder" /></objects></scene></scenes><resources><!-- 推薦尺寸:1242x2688 (@3x) 以適配所有 iPhone --><image name="dc_launchscreen_portrait_background.png" width="1242" height="2688" /><image name="dc_launchscreen_icon.png" width="120" height="120" /></resources>
</document>
將3個文件壓縮成zip,hbuilderx中選擇zip
發行-云打包到手機即可,重新自定義基座應該也會生效,不生效就卸載原應用重新安裝