我有一個基本的應用程序與三個視圖和第一個視圖,初始視圖,有一個320 x 460(我也試過320 x 480)ImageView ImageView作爲我的背景圖像視圖。狀態欄已啓用。當我在手機上測試應用程序時,圖像會在應用程序第一次加載時調整大小,並最終縮放以適應屏幕。我的圖片尺寸有誤嗎?當應用程序第一次加載時,初始視圖似乎「跳躍」,因爲圖像調整大小,我不希望用戶認爲有問題。BG Image Resizing
這是我的故事板:
<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>
你的意思是Default.png? –
我爲初始視圖創建了一個圖像。它叫做targetbg.png – DataGuy
好,什麼是「圖片大小調整」? –