dji*_*i33 62 xcode objective-c interface-builder ios autolayout
我在我的应用程序中第一次使用故事板
当我关闭Xcode时,我有关于错误放置的视图或与我的故事板有关的任何内容的0警告.当我重新启动Xcode并打开故事板时,我的15个场景中有3个放错了视图警告.
没有触及任何东西(除了选择文件),我可以发出一个git status
并看到.storyboard文件有变化.如果我git diff
,我看到这包含在文件的多个区域:
<variation key="widthClass=compact" misplaced="YES">
<rect key="frame" x="8" y="56" width="130" height="34"/>
</variation>
Run Code Online (Sandbox Code Playgroud)
如果元素已经有<variation key="widthClass=Compact"
节点,则添加misplaced
属性和rect
节点.
要使警告消失,我唯一需要做的就是点击每个警告,确保选中"更新框架",然后单击"修复错位".这修复了一切,直到我重新启动Xcode.
我场景的基本结构是:
UIView
UICollectionView
UICollectionReusableView
UICollectionViewCell
UICollectionViewCell
UISegmentedControl
Run Code Online (Sandbox Code Playgroud)
每次重新启动时如何防止这种情况发生?