我创建了一个flutter应用程序,然后使用情节提要板添加了带有XCode的启动屏幕。我的启动屏幕包含与底部对齐的背景图片和居中徽标。现在,每次我启动该应用程序时,在实际的启动屏幕出现之前都会出现一个白屏。这是我的LaunchScreen.storyboard:
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_1" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<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 opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFill" insetsLayoutMarginsFromSafeArea="NO" image="LaunchImage.Background" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
<rect key="frame" x="0.0" y="84" width="414" height="812"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchImage.Center" translatesAutoresizingMaskIntoConstraints="NO" id="m2E-Yf-1dK">
<rect key="frame" x="79" y="431" width="256" height="34"/>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="4X2-HB-R7a"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="7gX-RD-p4w"/>
<constraint firstAttribute="trailing" secondItem="YRO-k0-Ey4" secondAttribute="trailing" id="SGD-Ee-rA9"/>
<constraint firstItem="m2E-Yf-1dK" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="Uz2-O6-cFf"/>
<constraint firstItem="m2E-Yf-1dK" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="f3e-ab-K73"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="76.811594202898561" y="251.11607142857142"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage.Background" width="375" height="812"/>
<image name="LaunchImage.Center" width="256" height="34"/>
</resources>
</document>
我试图弄清楚为什么此白屏会在实际启动屏幕之前显示,并且我尝试了其他其他stackoverflow问题中建议的许多措施,但无济于事。现在我没有头绪。
答案 0 :(得分:1)
我自己能够解决此问题,事实证明这是一个缓存问题。与
flutter clean
并在iOS仿真器上擦除设备设置和内容,白屏消失了。
答案 1 :(得分:-1)
**您的IP地址可能会自动更新-因此请确保在运行npm run serve
时,该IP地址与您的capcitor.config.json
中的IP地址匹配