简体   繁体   English

如何在 Xcode Simulator 中修复此图像大小?

[英]How can I fix this image size in Xcode Simulator?

https://imgur.com/gallery/pTGAUnY https://imgur.com/gallery/pTGAUnY

I draw it in Xcode, but the simulator inside of picture is getting bigger.我是用Xcode画的,但是里面的模拟器越来越大了。 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.为了安全起见,我个人更喜欢将 Content-Mode 设置为Aspect Fit / Aspect Fill以增加对图像纵横比的控制。

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.如果您选择Aspect Fill ,请记住标记Clip-to-Bounds ,因为如果您不这样做, image-frame之外的image-frame一侧将不会被自动剪切。

There's screenshots in the hyperlink, I hope they help.超链接里有截图,希望对你有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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