具有尺寸类别的iPhone(从5到6加)的比例布局 [英] Proportional layout for iPhones (from 5 to 6 Plus) with Size Classes

查看:170
本文介绍了具有尺寸类别的iPhone(从5到6加)的比例布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过了一些关于大小课程的教程,但我仍然无法理解一件事。

I have passed through a number of tutorials about Size Classes but still I cannot figure out one thing.

iPhone 5,iPhone 6和iPhone 6 Plus绝对是相同的屏幕宽高比,所以我希望他们使用相同的内容布局。通过说同样的意思,我的意思是与屏幕的宽度和高度成比例。

iPhone 5, iPhone 6 and iPhone 6 Plus have absolutely the same screen aspect ratios, so I want them to use the same content layout. By saying the same I mean proportional to width and height of the screen.

但是!我找不到让它与所有iPhone成比例的方法!

But! I cannot find a way to make it proportional for all iPhones!

只有一些限制真正支持比例:纵横比,相同宽度+乘数,相同高度+乘数

There are just a few constraints that truly support proportions: "Aspect Ratio", "Same Width" + "Multiplier", "Same Height" + "Multiplier"

约束,例如前导边,容器中的水平中心,所有Pin约束都以逻辑点中的绝对值运行,并且所有iPhone的屏幕在逻辑点上都有不同的大小;因此我无法在所有iPhone上实现相同的图片。

Constrains, such as Leading Edges, Horizontal Center In Container, all Pin constraints operate with absolute values in logical points, and all iPhones' screens have different sizes in logical points; thereby I cannot achieve the same picture on all iPhones.

我正在添加图片来解释我想要实现的目标:

I'm adding an image to explain what I want to achieve:

推荐答案

如果你想使用更大的屏幕,你可能根本就不包括4.7的启动文件或启动图像和5.5设备,他们将只使用放大的4布局。

If you want to make such poor use of bigger screen, you could simply not include launch file or launch images for 4.7" and 5.5" devices and they will just use a scaled-up 4" layout.

但请不要做任何这些。屏幕可能是相同的方面比例,但它们的大小不一样,并以这种方式对待它们会造成糟糕的用户体验。

But please don't do any of that. The screens might be the same aspect ratio, but they are not the same size and treating them that way makes for a bad user experience.

这篇关于具有尺寸类别的iPhone(从5到6加)的比例布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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