简体   繁体   中英

Auto-layout changing depending on view as setting on simulator

I am noticing something strange using XCode 9.3.

I have a view with a UIToolBar on the bottom of it. I have set the following constraints:

  1. Align Center X to: superview
  2. Trailing Space (0): superview
  3. Leading Space (0): superview
  4. Equal Width: superview
  5. Bottom Space (0): superview
  6. Height equals 44.

The superview is a UIView.

When I viewAs iPhone 8 and then load an iPhone SE Simulator you can see the pink section on the image is where the toolbar is not satisfying rule 4 above.

SE模拟器中的工具栏宽度问题;查看方式:iPhone 8

However, if I set viewAs iPhone SE, it works perfectly:

SE Simulator中的收费栏没有宽度问题;查看为SE

Any ideas anyone?

I've done no Vary for Traits.

Trailing Space (0): superview

Leading Space (0): superview

Bottom Space (0): superview

Height equals 44.

You just need these 4 constraints

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