计算所有尺寸的iphone的纵横比 [英] Calculating Aspect Ratio for all sizes of iphone

查看:280
本文介绍了计算所有尺寸的iphone的纵横比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个类型的问题已被问过几次,但我对iphone比较新,所以对所有答案都很困惑。因为我的标识是61 * 57,我想根据iphone的大小改变。但是当我为所有屏幕指定它的宽高比时,它会给出自己的比例。但我很困惑这个比率是如何计算的。对于5.5英寸,他们推荐使用17:184(对于4.7 61:667 4英寸61:568)和3.5英寸61:480。

I know this types question has been asked several times but i am newer to iphone so confused with all answers.As my logo is 61*57 and i want to change according to size of iphone. but when i specify it's aspect ratio for all screen it gives their own ratio. But I am confused how this ratio has been calculated. for 5.5 inch they have recommende 17:184 for 4.7 61:667 4 inch 61:568 and for 3.5 inches 61:480.

推荐答案

首先,您将X,Y和宽高比给予图标

So first You give X , Y and aspect ration to the icon

然后你给你的图标的高度等于超级视图的高度

Then you give your icon's heigh equal to superview's height

然后将当前图标的高度除以刚刚给出的superview的高度

Then you divide your current icon's height by superview's height that you just gave

你在等于高度的分数答案:Superview ' s 乘数:

完成后

这篇关于计算所有尺寸的iphone的纵横比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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