-2

I'm making a calculator application and having trouble figuring out what could be causing this problem. I have dynamic layouts for the storyboard and I can run my application on any iPhone version/iPad version in xcode and everything is laid out correctly. However as soon as I run it on my own iPhone 5s the buttons are completely different, they move, resize and no longer have numbers on them.

I'm confused because I have even tried to run on an iPhone 5s emulator with the same ios as my iPhone and that works perfectly.

Is there something I'm not taking into account here?

Layout with constraints in xcode

How it appears on my iPhone 5s

B-Brennan
  • 111
  • 9
  • Please add a screenshot of simulator and device. Also, you can add a screenshot of storyboard with constraints. – Quver Nov 18 '17 at 11:10
  • I added screenshots, hopefully that helps – B-Brennan Nov 18 '17 at 12:04
  • Hmm, you can try clear simulator and remove the app from iPhone and test again. If you still see the difference, I would create constraint again from scratches. If you still have problems you can send me storyboard and I would try to help you. – Quver Nov 18 '17 at 21:31

1 Answers1

0

There are some reasonable explanations: One is that you have two many constraints in your layout that cannot all be fulfilled at the same time, and then it is quite possible that two devices will behave differently. Check in the debugger output for any relevant messages.

It is possible that you have some code that checks whether it's running on a real device or a simulator (I have some code doing that, but it is very very rare). Check all code doing that.

And it is possible that you are accessing data that is on your build machine and that isn't there when you run your code on a device.

Other than that, I'd like to know what's going on myself.

gnasher729
  • 51,477
  • 5
  • 75
  • 98