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

前端 未结 14 2050
别跟我提以往
别跟我提以往 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 08:03

    for me the problem was that i was hiding the bottom bar on push (using IB checkbox).

    i had to select 'none' in 'bottom bar' option:

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

    Xcode 12

    I think this problem is mostly because the width of device preview is different per various devices. E.g. iPhone 12 and iPhone 11 have different screenWidth. If you set a fix value on width of some view and give it some constraints, then it may not adopt your current previewed iPhone's screen width, so it complained "different size in run time".

    And for me, I set an UIView and ImageView's width & height as fixed value in size inspector with iPhone 11 preview. And gives it also fixed 10 points leading and trailing constraints in IB. Then it complained if I switch to iPhone 12 preview.

    To fix it, I select the viewController and chose "Update Frames". Then it looks better but Xcode still complain one conflict constraint after the change. Eventually, I manually found and fix it in IB.

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

    Click "View As" at the bottom left of your storyboard and choose a different device size, then click it again and swap back to the device size you started with. This worked for me.

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

    I tried all the above suggestions but it didn't seem to work. I think it might be a more serious bug.

    I have logged a bug with Apple Bug Reporter( link: https://bugreport.apple.com/logon) - if you want to do the same, then please reference bug : 31355220 so that Apple can tie it together. The more people that report it - the more information they will have to fix this annoyance.

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

    I was able to get rid of the issue completely by setting the simulated size of the view controller to freeform and then setting the width from 375 to 320.

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

    Please change your device Preview in xcode for View controller and compile and check for warnings...

    Xcode 8 is bit buggy, Interface builder reset its with random no which affects all contained views. Try changing your preview device.

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