Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is there a white screen before the actual launch screen appears in iOS simulator

I created a flutter app and then added a launch screen with XCode by using a storyboard. My launch screen contains a background image that is aligned to the bottom and a centered logo. Now every time I start the app, there is a white screen before the actual launch screen appears. This is my 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>

I tried to figure out why this white screen is showing before the actual launch screen and I tried many things suggested in other stackoverflow questions but to no avail. Right now I do not have a clue.

like image 305
Mark Avatar asked Sep 05 '19 13:09

Mark


People also ask

Why is my app showing a white screen?

If your apps are moved to your SD card, and you are running them from there, this might be the cause of the white screen of death issue. You can fix this by moving the apps back to the internal storage. Install the free Move app to SD card app on your phone.

How do I get rid of white screen before splash screen flutter?

On the right hand side under properties, you will find the background attribute. Clicking on this and choosing custom will allow you to define the RGB value to override the white screen. After following these steps, your app will now no longer show the annoying white screen on either Android or iOS.

What is the difference between launch screen and splash screen?

Splash Screen is the very first screen the user sees when they open up an app on a mobile device. It's the very first chance of creating a positive impact on the users. It appears while the app is loading when the user has just opened up the app. Many times the Splash screen is called a launch screen.

What is iOS launch screen?

Every iOS app must provide a launch screen, a screen that displays while your app launches. The launch screen appears instantly when your app starts up and is quickly replaced with the app's first screen.


1 Answers

I was able to solve this issue myself, it turns out to be a caching issue. With

flutter clean

and erasing the device settings and contents on iOS simulator, the white screen disappeared.

like image 61
Mark Avatar answered Oct 19 '22 14:10

Mark