在 iPhone 上为不同的图像尺寸使用 Xcode 自动布局 [英] Use Xcode Auto Layout for different image sizes on iPhone

查看:30
本文介绍了在 iPhone 上为不同的图像尺寸使用 Xcode 自动布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用纵向 iPhone 的自动布局,我不希望 iPhone 6+ 上的游戏角色的 UIImageViews 大小与 iPhone 4S 中的完全相同.4S字要小一些,否则会显得太大.使用 Auto Layout 如何更改 iPhone 之间的图像大小,因为它们似乎都更改为相同大小而不受约束.

With Auto Layout for iPhones in Portrait, I don't want the exact same size UIImageViews for game characters on iPhone 6+ as in iPhone 4S. The 4S characters need to be smaller or else they'll look too big. Using Auto Layout how do I change image sizes between iPhones because they seem like they all change to be the same sizes regardless of constraints.

推荐答案

我确信它们会更小,因为当您添加图像时,您会添加 3 种尺寸的图像:@1x、@2x 和 @3x.这些图像使该图像适用于所有 Apple 设备.在您的模拟器中试用它们.

I am sure that they would be smaller because when you add images, you add 3 sizes of the image: @1x, @2x, and @3x. These images make the image universal for all Apple devices. Try them out in your simulator.

这篇关于在 iPhone 上为不同的图像尺寸使用 Xcode 自动布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆