简体   繁体   中英

Specify Different width to 'View' for iPhone and iPad Xcode 9

我有一个“视图”,没有为其添加任何宽度,并且在我指定了宽高比的情况下,它在不同的iPhone尺寸下都可以正常工作,但是当我切换到iPad时,“视图”会拉伸以占用iPad的整个空间指定iPad中“视图”的宽度,是否有人做过此事?

You need to disable the aspect ratio constraint for IPad and create a suitable one for it like this

1- Un install the aspect ratio constraint , click the + icon near installed from the popup select Regular for width and height , then click add variation

在此处输入图片说明

2- And un Check it for RR

在此处输入图片说明

3- Select any IPad device in the bottom Bar , click vary for traits and make the new aspect ratio constraint as you want then click Done varying 在此处输入图片说明

By this you have 2 different constraints for the aspect ratio when you run the app in IPhone or Ipad , Note: you can do it for any constraint you want

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