Ios UI按钮未显示

Ios UI按钮未显示,ios,objective-c,uibutton,storyboard,Ios,Objective C,Uibutton,Storyboard,在故事板中-我将按钮设置为最后一个子视图,使其位于背景图像上方。 但是,我仍然看不到按钮,我想它隐藏在图像下 参考第二个按钮,go.png。第一个没问题 编辑: 显然,tableview隐藏了按钮,尽管它在情节提要中位于按钮之前 有什么想法吗 .storyboard片段: <view key="view" contentMode="scaleToFill" id="VfA-Cc-YiX"> <rect key="frame"

在故事板中-我将按钮设置为最后一个子视图,使其位于背景图像上方。 但是,我仍然看不到按钮,我想它隐藏在图像下

参考第二个按钮,go.png。第一个没问题

编辑: 显然,tableview隐藏了按钮,尽管它在情节提要中位于按钮之前 有什么想法吗

.storyboard片段:

<view key="view" contentMode="scaleToFill" id="VfA-Cc-YiX">
                        <rect key="frame" x="0.0" y="0.0" width="320" height="519"/>
                        <autoresizingMask key="autoresizingMask"/>
                        <subviews>
                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="background_photo.png" id="xWd-g0-aHG">
                                <rect key="frame" x="20" y="262" width="280" height="254"/>
                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                            </imageView>
                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="fridge_top_part.png" id="Sg5-CB-aKi">
                                <rect key="frame" x="20" y="215" width="280" height="50"/>
                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                            </imageView>
                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="a6Z-L3-Daf">
                                <rect key="frame" x="35" y="267" width="250" height="244"/>
                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                <view key="tableFooterView" contentMode="scaleToFill" id="ATM-Ot-Ivk">
                                    <rect key="frame" x="0.0" y="0.0" width="250" height="330"/>
                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                                </view>
                            </tableView>
                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="top_fridge.png" id="9qW-rM-RRr">
                                <rect key="frame" x="20" y="72" width="280" height="134"/>
                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                            </imageView>
                            <button opaque="NO" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="jP0-zQ-NGs">
                                <rect key="frame" x="45" y="109" width="240" height="37"/>
                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                <state key="normal" backgroundImage="whats_in_your_fridge.png">
                                    <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
                                </state>
                                <connections>
                                    <segue destination="41Y-sX-NH8" kind="push" id="3Xy-Cf-d3a"/>
                                </connections>
                            </button>
                            <button opaque="NO" tag="2" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="MWR-LQ-ebu">
                                <rect key="frame" x="250" y="475" width="50" height="41"/>
                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                <state key="normal" backgroundImage="Go.png">
                                    <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
                                </state>
                                <connections>
                                    <segue destination="beU-gc-427" kind="push" id="9Ff-ak-y4O"/>
                                </connections>
                            </button>
                        </subviews>
                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                    </view>
可能的问题 此按钮可能位于主UIView之外,也可能尺寸较小

可能的解决办法
首先显示该按钮的大小检查器,并检查该按钮的大小和位置。如果有任何负值,请尝试更改它们。

嗯,这是一个挑战。你能捕获这个按钮的图像吗?不确定它有什么帮助,但我为你获得了故事板的图像。看起来你想将按钮添加为图像视图的子视图。看到这个:也请把图像放回去,因为它比查看XML要好。@trojanfoe-我不确定我是否遵循。。。请参阅最新编辑带回的图像,抱歉,尺寸检查器的位置是确定的。我设法弄明白了,尽管在故事板上,tableview将其隐藏在它的下面。有什么修复方法吗?尝试为该图像提供自动布局,并剪辑其子视图