Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
IOS启动屏幕正确渲染,然后元素跳转到顶部_Ios_Swift_Storyboard_Splash Screen_Xcode Storyboard - Fatal编程技术网

IOS启动屏幕正确渲染,然后元素跳转到顶部

IOS启动屏幕正确渲染,然后元素跳转到顶部,ios,swift,storyboard,splash-screen,xcode-storyboard,Ios,Swift,Storyboard,Splash Screen,Xcode Storyboard,因此,我有以下启动屏幕: 正常加载,然后跳到以下位置: 我的约束条件如下:因此我认为我的元素得到了适当的约束,而且在检查xcode中的不同设备时,一切看起来都正常。但一旦应用程序启动,它就可以正确加载,但在加载下一个视图之前,所有内容都会跳转到顶部 <?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" vers

因此,我有以下启动屏幕:

正常加载,然后跳到以下位置:

我的约束条件如下:因此我认为我的元素得到了适当的约束,而且在检查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>


从发布时开始将图像设置为适合的方面。故事板

我将徽标约束到布局中,而不是沿垂直轴的superview:对我起作用的S检查约束是否引用Superview而不是布局:

  • 单击预览左侧列表中的特定约束
  • 在预览右侧的检查器中(选择菜单视图->检查器->显示检查器,如果不可见),单击三个滑块图标显示属性检查器
  • 查看第一项和第二项条目。如果其中任何一个引用了布局,请单击菜单并选择Superview
  • 对其余约束重复此操作。保存并构建

  • 当事情出现在错误的地方,通常意味着你没有足够的约束。在本例中,什么将决定
    growthdecks\u logo\u white
    图像视图的高度/底部?诸如此类。你能进一步说明你的意思吗?我有一个类似的问题,不能理解你的修复基于这句话单独?您是如何纠正这个约束问题的?如果您不习惯,xCode确实很难用于这些事情。@HBG嗯,它非常具体,我也不再有那个代码了;D如果你给我发了一张截图,我可以看一下:)(或者GitHub repo,或者以某种方式查看约束条件)是的,这个答案什么也没说。这里的超视野是什么?