简体   繁体   中英

How to fix button size if changing screen orientation?

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

这是纵向时的正确布局

landscape

这是横向时的正确布局

bigger button when changed orientation

改变方向时较大的按钮

The solution I tried was the image below:

Attached equal heights

附加到滚动视图

子布局

Set to 0.18 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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM