2

Currently I’m working in this project where I need to resolve a UI issue for iPhone X. I did some reading that said developers can use safe areas in XIB and it will resolve the problem. So I did it, and the simulator looks fine, but not my real device.

enter image description here

All the UI Components are attached to safe area. But only iPhone X simulator looks okay. How do I resolve this?

vqdave
  • 2,361
  • 1
  • 18
  • 36
Wong Wengkeong
  • 181
  • 1
  • 14
  • 1
    In order to discover the discrepancy, I suggest you to enable the "Debug View Hierarchy" and check if there is anything strange, comparing simulator/device. – mugx Dec 08 '17 at 04:02
  • @AndreaMugnaini there is nothing strange. just that the screen is not attached to the safe area. meanwhile UI from storyboard looks fine in real device and simulator. Just that UI from xib itself looks weird in real device. – Wong Wengkeong Dec 08 '17 at 04:45
  • I’d confirm that the binary on your phone matches the one in the simulator. Delete and reinstall, and clean too. – brandonscript Dec 08 '17 at 05:56
  • @brandonscript thanks alot mate. you were right. – Wong Wengkeong Dec 08 '17 at 07:11

1 Answers1

2

I found out the answer. Apparently, it was because XIB files were cached. I have to clean the project and re-run it. And it's working perfectly.

Wong Wengkeong
  • 181
  • 1
  • 14