IOS初始屏幕正确呈现,然后元素跳到顶部

问题描述 投票:-1回答:1

所以我有以下启动画面:

enter image description here

正常加载,然后跳至以下内容:

enter image description here

我的约束如下:S所以我认为我的元素受到了适当的约束,而且在检查xcode中的不同设备时,一切都还不错。但是,一旦应用启动,它就可以正确正确地进行初始加载,但是在加载下一个视图之前,所有内容都会跳到顶部。

<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina3_5" orientation="portrait" appearance="light"/>
<dependencies>
    <deployment identifier="iOS"/>
    <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
    <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="320" height="480"/>
                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                    <subviews>
                        <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFill" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
                            <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
                        </imageView>
                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="growthdecks_logo_white" translatesAutoresizingMaskIntoConstraints="NO" id="oIG-AW-V5d">
                            <rect key="frame" x="38" y="110" width="245" height="260.5"/>
                        </imageView>
                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="millesanders_logo_white" translatesAutoresizingMaskIntoConstraints="NO" id="RMx-ME-VmL">
                            <rect key="frame" x="103" y="398" width="115" height="82"/>
                            <constraints>
                                <constraint firstAttribute="height" constant="82" id="rA5-25-iAt"/>
                            </constraints>
                        </imageView>
                    </subviews>
                    <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                    <constraints>
                        <constraint firstItem="RMx-ME-VmL" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leadingMargin" constant="87" id="40k-Ob-jLK"/>
                        <constraint firstAttribute="trailingMargin" secondItem="oIG-AW-V5d" secondAttribute="trailing" constant="21" id="8zN-eu-A0s"/>
                        <constraint firstAttribute="trailing" secondItem="YRO-k0-Ey4" secondAttribute="trailing" id="CfB-dj-2FI"/>
                        <constraint firstAttribute="trailingMargin" secondItem="RMx-ME-VmL" secondAttribute="trailing" constant="86" id="D7Z-vK-LvD"/>
                        <constraint firstItem="YRO-k0-Ey4" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="Heg-3Y-CWr"/>
                        <constraint firstItem="oIG-AW-V5d" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leadingMargin" constant="22" id="QGg-5c-RsU"/>
                        <constraint firstItem="YRO-k0-Ey4" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="ZYU-cd-jlT"/>
                        <constraint firstItem="oIG-AW-V5d" firstAttribute="top" secondItem="Ydg-fD-yQy" secondAttribute="bottom" constant="110" id="nP2-0E-Opq"/>
                        <constraint firstItem="xbc-2k-c8Z" firstAttribute="top" secondItem="RMx-ME-VmL" secondAttribute="bottom" id="qQf-sf-irV"/>
                        <constraint firstAttribute="bottom" secondItem="YRO-k0-Ey4" secondAttribute="bottom" id="uzq-64-XwI"/>
                    </constraints>
                </view>
            </viewController>
            <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
        </objects>
        <point key="canvasLocation" x="75.362318840579718" y="250.44642857142856"/>
    </scene>
</scenes>
<resources>
    <image name="LaunchImage" width="2344.5" height="5075"/>
    <image name="growthdecks_logo_white" width="261" height="260.5"/>
    <image name="millesanders_logo_white" width="1152.5" height="260.5"/>
</resources>

我正在使用颤振,但我认为这是一个本地ios问题:S这就是xcode中的样子

enter image description here

ios swift storyboard splash-screen xcode-storyboard
1个回答
0
投票
将图像设置为从launch.storyboard适合的外观
© www.soinside.com 2019 - 2024. All rights reserved.