0

I have this app wherein in requires to change the screen orientation. First image is for portrait and Second image is for landscape. But there are instances that the two(2) buttons become large when I change the orientation from landscape to portrait. The third image will show you how big the buttons after changing orientation which is it does not follow the correct portrait layout.

portrait

This is the correct layout when in portrait orientation

landscape

This is the correct layout when in landscape orientation

bigger button when changed orientation

The bigger button when changed orientation

The solution I tried was the image below:

Attached equal heights

Attached to scroll view

sublayout

Set to 0.18 proportional height

Proportional Height

I am having a hard time to fix this issue aside from, it is the first time I encountered this issue, the issue does not appear 100% and this issue usually appear in iPhoneX series specifically iPhoneX. Hope you can help me regarding this. Thank you in advance.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Titus
  • 349
  • 4
  • 19

2 Answers2

0

Always use size class to handle objects in different screens. Or the other option is to use Stack. But size class is always the best option.

Reed
  • 944
  • 7
  • 15
0

Use vary for traits (Size classes) and provide constraints for width & height for each button for different orientations.

Help
  • 84
  • 4
  • you can refer to this question - https://stackoverflow.com/questions/39890055/what-is-vary-for-traits-in-xcode-8 – Help Nov 11 '19 at 06:40