2

I have a "view" inside a UITableview (header) but in landscape mode it does not respect the Safe Area on the iPhone X. Screenshot

Any suggestions to solve this problem?

Update: Thanks for the suggestions from @matt, @ Tj3n , @AlbertB and @dahiya_boy, I added the "safe area" and with that I solved the problems.

safe Area

Mario Burga
  • 1,107
  • 1
  • 13
  • 19
  • Usse safegaurd from storyboard left pannel. – dahiya_boy Jul 27 '18 at 06:50
  • How to add a "safe area"? The UITableViewController does not add – Mario Burga Jul 27 '18 at 06:58
  • 2
    The problem is your leading and trailing constraints are wrong. In the header view I see two views. The leading edge of the first and the trailing edge of the second need to be pinned with autolayout to the safe area. That way, the header view itself will be wide but the views will be inside the safe area. – matt Jul 27 '18 at 07:05
  • @matt Inside the view there is another view and labels https://i.stack.imgur.com/oTy6A.jpg – Mario Burga Jul 27 '18 at 07:10
  • 1
    The subviews inside the header view have to respect safe area – Tj3n Jul 27 '18 at 07:11
  • 1
    Ok but that doesn’t change what I’m saying. The reason they don’t respect the safe area is you didn’t pin them to the safe area. – matt Jul 27 '18 at 07:11
  • 2
    @MarioBurga Use this [link](https://stackoverflow.com/questions/46222000/cant-use-safe-areas-in-xcode-9-after-upgrading-minimum-deployment-target-to-ios?rq=1) to unable safe area in storyboard – dahiya_boy Jul 27 '18 at 07:50

1 Answers1

2

In the VIEW, make sure you have activated these options.

enter image description here

AlbertB
  • 637
  • 6
  • 16