无法加载" usflag.png"从包含标识符" test.icon"的包中的nib引用的图像

时间:2015-08-26 18:14:25

标签: ios xcode button

我无法找到收到此消息的原因:

无法加载" usflag.png"从带有标识符的包中的笔尖引用的图像...

我创建了2个按钮,将类型设置为自定义,选择2 png作为图像。在Xcode中一切正常。它显示第一个按钮的模拟器正常,我得到第二个按钮的错误,显示除了图像。

我在Xcode 6.4上获得了类似的效果,然后转到7 beta 4但没有成功。

任何想法如何解决这么简单的事情?

我添加了main.storyboard的源代码:

                   <subviews>
                        <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="fill" contentVerticalAlignment="fill" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hFS-FI-nNd">
                            <rect key="frame" x="20" y="28" width="42" height="30"/>
                            <state key="normal" image="french_flag.png">
                                <color key="titleColor" red="0.0" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
                            </state>
                        </button>
                        <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="fill" contentVerticalAlignment="fill" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FGS-JR-8HH">
                            <rect key="frame" x="20" y="66" width="42" height="30"/>
                            <state key="normal" image="usflag.png">
                                <color key="titleColor" red="0.0" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
                            </state>
                        </button>
                    </subviews>

0 个答案:

没有答案