Search code examples
iosnslayoutconstraintuiinterfaceorientationautolayout

Xcode:Autolayout set a view to always be in top


I'm trying to set a view to always be in top be so far I have not figure out how to do it. In this case it shows correctly:

enter image description here

But in this case it doesn't:

enter image description here

How do I need to set up my view with auto layout in way the view always shows in top?

I'll really appreciate your help.

Here is how I setup the view in interface builder:

enter image description here


Solution

  • Check the screenshots, works well for me.The constraints

    enter image description here

    enter image description here