Warning frame for “Navigation bar” will be different at run time appears in Xcode 8 Swift 3

前端 未结 14 2048
别跟我提以往
别跟我提以往 2020-12-02 07:35

Before I\'ve upgraded to Xcode 8 I haven\'t seen this error in such case. I have different Navigation Controllers. For all of them I see an error Frame fo

相关标签:
14条回答
  • 2020-12-02 07:47

    Warning will disappear if you change the property "Simulated Size" to "Freeform".

    0 讨论(0)
  • 2020-12-02 07:53

    As a workaround just to get rid of the annoying warning I have been editing Main.storyboard manually by removing 'misplaced' in:

    <navigationBar key="navigationBar" opaque="NO" contentMode="scaleToFill" misplaced="YES" translucent="NO" id="Os1-Xh-7XN">
    

    A hack but it is nice to have zero warnings rather than 1 :)

    0 讨论(0)
  • 2020-12-02 07:54

    Okay so it looks like I've fixed the issue. Here's what I did.

    Select update frames like normal. Open a different file and then click back on the storyboard file. If that doesn't work then restart Xcode. It looks like it was updating internally but the interface builder UI was stuck as it sometimes gets.

    0 讨论(0)
  • 2020-12-02 07:55

    Until Xcode 8 is patched, you can set the "View as:" option to "iPhone SE" to eliminate the warning. Not ideal, but works for now.

    0 讨论(0)
  • 2020-12-02 07:59

    As mentioned here you can fix this by toggling Adjust Scrollview Insets on/off.

    0 讨论(0)
  • 2020-12-02 08:02

    This worked for me at Xcode 8.3.1 After restarting Xcode, it would still work.

    1. Select Navigation Controller

    1. Go to Show the Size Inspector

    1. Change Simulated Size to Freeform

    1. Change Simulated Size back to Fixed

    1. Then the warnings disappear.

    0 讨论(0)
提交回复
热议问题