iOS7 - View under status bar - edgesForExtendedLayout not working

前端 未结 7 1969
予麋鹿
予麋鹿 2020-12-28 17:30

I have a project that was built last year, and it uses XIBs, no storyboards. The XIBs do not use Auto Layout, but they do use some Autosizing. I have an issue when running

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-28 17:56

    Have you tried viewing your XIBs as source and removing any line containing edgesforextendedlayout ??

    We had to remove this line in our storyboard's scenes since our storyboard's scenes' main views are represented by XIBs

    What was happening for us was that somehow, in some scenes, the XIB content for the scene's main view was being pushed down by the height of the status bar and the navigation bar.

    Removing that line allowed the XIBs to be displayed as if their top originated at the same top of its storyboard's scene.

    Sadly, we have no idea what triggered this, but I saw it happen when changing the order of the contents within the XIB's main view so that a UITextView appeared first. Rearranging the order of items after this was triggered had no effect in removing this unwanted behaviour.

    Hope this helps anyone else running into this type of problem.

提交回复
热议问题