我正在使用Xcode 5.
出于某种原因,如果我将Image View放入Collection View Cell
,我会收到以下警告2013-11-20 06:21:39.987 Interface Builder Cocoa Touch Tool[1237:303]
WARNING:
Reason: Could not find layout engine view for view's (<UIView: 0x102939b0; frame = (-20 -20; 90 90); autoresize = RM+BM; layer = <CALayer: 0x10288690>>) coordinate space view <UIView: 0x1028aaf0; frame = (0 0; 50 50); autoresize = W+H; gestureRecognizers = <NSArray: 0x10298620>; layer = <CALayer: 0x10299730>>. But the canvas coordinateSpaceView is view's superview, so we are assuming the same in the layout engine.
File: /SourceCache/IBAutolayoutFoundationIOS/IBAutolayoutFoundation-3430/Framework/Classes/Arbitration/IBAutolayoutEngine.m:335
Method: -[IBAutolayoutEngine layoutFrameForView:inCoordinateSpaceOfView:]
这些警告会污染编译输出,有时我会遗漏重要信息。
我怎样摆脱它?
以下是导致它的故事板片段:
<collectionView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" restorationIdentifier="zzzzz" minimumZoomScale="0.0" maximumZoomScale="0.0" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="esr-tl-gXA">
<rect key="frame" x="80" y="104" width="160" height="207"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="dJb-8s-18M">
<size key="itemSize" width="50" height="50"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="A9w-gO-BzK">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="55Z-yW-7Qm">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</collectionViewCell>
</cells>
</collectionView>
答案 0 :(得分:1)
我一直在努力解决这个问题(获得类似的ibtool错误和异常),并尝试了以下所有方法:
即使在迁移到Storyboard后,偶尔会弹出相同的错误,但我发现以下内容可以解决它:
这是一个苹果当然,我已经提出过它。