我有一个包含三个视图的基本应用程序,第一个视图(初始视图)有一个 ImageView,其中包含一个 320 x 460(我也尝试过 320 x 480)的图像,作为视图的背景图像。状态栏已启用。当我在手机上测试应用程序时,图像会在应用程序首次加载并最终缩放以适应屏幕时调整大小。我的图像尺寸做错了什么?由于图像大小调整,当应用程序首次加载时,初始视图似乎“跳跃”,我不希望用户认为存在问题。
这是我的故事板:
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="vni-Jh-JGC" userLabel="First Responder" sceneMemberID="firstResponder"/>
<viewController id="gWY-GQ-C35" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="e8S-C8-ddz">
<rect key="frame" x="0.0" y="20" width="320" height="460"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView autoresizesSubviews="NO" userInteractionEnabled="NO" contentMode="scaleToFill" image="targetbg.png" id="s7d-M3-VIr">
<rect key="frame" x="-1" y="0.0" width="320" height="460"/>
<autoresizingMask key="autoresizingMask"/>
<rect key="contentStretch" x="0.0" y="0.0" width="0.0" height="0.0"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="uF7-4u-0PX">
<rect key="frame" x="14" y="417" width="300" height="38"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="newsubmit.png">
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
</state>
<state key="highlighted">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<segue destination="2" kind="modal" id="Qkv-0y-8Sh"/>
</connections>
</button>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Blake Design Group" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="Am2-mX-6Yv">
<rect key="frame" x="22" y="386" width="280" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="version 2.0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="Buw-jD-jIs">
<rect key="frame" x="16" y="374" width="280" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<nil key="simulatedTopBarMetrics"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics"/>
</viewController>
</objects>