简体   繁体   中英

How can I fix this image size in Xcode Simulator?

https://imgur.com/gallery/pTGAUnY

I draw it in Xcode, but the simulator inside of picture is getting bigger. Does anyone know how to fix it??

在此处输入图片说明

Try the highlighted constraints with red mark shown below.

在此处输入图片说明

The best practice is to set Height & Width constraints .

Be aware, by default, it will deform the aspect ratio of the image if you'r given constraints doesn't match the original image ratio.

To be safe, I personally prefer setting Content-Mode to Aspect Fit / Aspect Fill for added control over the aspect ratio of the image.

Remember to mark Clip-to-Bounds if you select Aspect Fill , as the the side of the image outside of the image-frame won't be automatically cut if you don't do so.

There's screenshots in the hyperlink, I hope they help.

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