界面生成器:UIView 的布局 iOS 6/7 Delta 有什么用? [英] Interface Builder: What are the UIView's Layout iOS 6/7 Deltas for?

查看:32
本文介绍了界面生成器:UIView 的布局 iOS 6/7 Delta 有什么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚注意到在 UIView 的结构布局下发现的 iOS 6/7 Delta 属性.

I just noticed the iOS 6/7 Delta property found under the UIView's structs layout.

这是做什么用的,为什么 AutoLayout 中没有?

What is this for and why is this missing from AutoLayout?

推荐答案

这其实是指从iOS6到iOS7的布局位置之间的差值.

This actually refers to the Delta between layout position from iOS6 to iOS7.

在 iOS7 中,某些视图可以隐藏状态栏或使其透明,实际上,它覆盖在您的视图之上.因此,如果您在 iOS6 上将 UI 元素放在 (0.0, 0.0) 处,它会显示在状态栏下方,但在 iOS7 上,它会显示部分覆盖在状态栏下方.因此,在这种情况下,您需要一个与状态栏高度(20.0 点)匹配的增量,以便布局在 iOS6 和 iOS7 中看起来相同.

In iOS7, some views can hide the status bar or have it transparent and, in effect, it is overlaid on top of your view. So if you put a UI element at (0.0, 0.0) on iOS6, it will appear below the status bar, but on iOS7 it would appear partially covered underneath the status bar. So in that case you would want a delta that matches the status bar height (20.0 points) so that the layout looks the same in iOS6 and iOS7.

如果您使用自动布局,我相信这不是必需的,但是当然,您将失去对 iPad1 的支持,我们中的许多人目前都不愿意承认这一点.

I believe this isn't needed if you use autolayout, but of course, then you lose iPad1 support, which many of us aren't willing to concede at this point in time.

这篇关于界面生成器:UIView 的布局 iOS 6/7 Delta 有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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