我有一个xib文件在Xcode 9中显示png图像,但在iPhone 5S模拟器中预览时呈现为白色图像。
该应用程序正常工作,否则。这是一个弹出屏幕的屏幕,带有图书购买优惠。立即购买链接按钮png显示正常,但背景png(splashbg_US_568h.png)为白色。
我尝试从索引中删除图像并再次添加它们和不同的模拟器硬件,但结果相同。
这是我的xib代码:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SplashScreenViewController">
<connections>
<outlet property="mAmazonButton" destination="7" id="Vsp-QR-ycJ"/>
<outlet property="mBgImageView" destination="4" id="16"/>
<outlet property="view" destination="1" id="3"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="1">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="splashbg_US_568h.png" id="4">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<gestureRecognizers/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="7">
<rect key="frame" x="98" y="475" width="125" height="38"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<state key="normal" image="splash.com.png">
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="buyAmazon:" destination="-1" eventType="touchUpInside" id="xYa-Ye-bxK"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<gestureRecognizers/>
<nil key="simulatedStatusBarMetrics"/>
</view>
</objects>
<resources>
<image name="splash.com.png" width="125" height="44"/>
<image name="splashbg_US_568h.png" width="115.21728515625" height="172.825927734375"/>
</resources>
</document>
我要提到的最后一件事是,虽然我设计了应用程序并为此付费,但我没有对其进行编码,因此我对Xcode项目的理解非常有限。我刚刚更新了图片和plist,并准备发布新的更新。
编辑:检查图像是否在Copy Bundle Resources中,它是:
TIA