ios dev关闭双重认证_iOS Dev Academy简短介绍(自动布局)

ios dev关闭双重认证

It’s been a while with all this Covid-19 going on since I have posted an article. I think that I am back in the groove of things again and not as “constrained” as I was before. This week I was really delving into Auto-Layout and what it helps you accomplish in making a User Interface of an app.

自从我发表文章以来,所有这一切都与Covid-19进行了一段时间。 我认为我又回到了困境中,不再像以前那样“受限制”。 这周,我真正地研究了自动布局,以及它如何帮助您制作应用程序的用户界面。

What is Auto-Layout? Well let’s break down the words. Auto is short for “automatic” meaning doing something automatically rather than manually. Layout, you can think of “laying out” a blueprint of a house. Where something belongs and exactly how much room and the dimensions it will take up. What Auto-Layout accomplishes is setting the dimensions or parameters of everything on your User Interface to where it will go and how much room it will take. You are basically setting the alignment and making sure everything looks nice and neat. You are also setting what are called “constraints” as to how far or how close they are to certain objects.

什么是自动版式? 好吧,让我们分解一下这句话。 自动是“自动”的缩写,表示自动而不是手动执行某项操作。 布局,您可以想到“布局”房屋的蓝图。 某物所属的位置以及确切占据的空间和尺寸。 自动布局的作用是将用户界面上所有内容的尺寸或参数设置为将要到达的位置以及需要多少空间。 您基本上是在设置对齐方式,并确保所有内容看起来都很好而整洁。 您还要设置所谓的“约束”,即它们与某些对象之间的距离或距离。

Image for post

The reason Auto-Layout is used is because not all apps will be working on the same device. Some may be on an old device like an iPhone 4 or some will be on the newest device which has 3 times the resolution or pixels. It can even be on something as large as an iPad. For this reason, we need our app to automatically layout the User Interface so that it looks nice and neat on any device. And not only different devices, but even look nice when you transition from holding your phone in portrait or landscape mode.

使用自动版式的原因是因为并非所有应用程序都可以在同一设备上运行。 有些可能位于旧设备(例如iPhone 4)上,有些可能位于分辨率或像素为3倍的最新设备上。 它甚至可以像iPad一样大。 出于这个原因,我们需要我们的应用程序自动布局用户界面,以使其在任何设备上看起来都很好。 当您从以纵向或横向模式握住手机过渡时,不仅设备不同,而且看起来也很漂亮。

Image for post

One of the tools used in Auto-Layout is a stackview. This is used how it sounds, buttons or whatever can be laid out one on top of another vertically (or horizontally)and then can be grouped together in a stack. By doing this, you can ensured all are the same size or equal distance apart making a nice stack of buttons. Then, you can set constraints to the stack to be a certain distance apart from another image, button, stackview, etc. Image below explains.

自动布局中使用的一种工具是堆栈视图。 可以使用它的声音,按钮或其他任何东西(可以垂直(或水平)放置在另一个顶部,然后可以组合在一起)。 这样,您可以确保所有按钮的大小相同或距离相等,从而形成一个漂亮的按钮堆栈。 然后,您可以将堆栈的约束设置为与另一个图像,按钮,堆栈视图等相距一定距离。下图说明。

Image for post

These can be confusing, and at times I was frustrated with them, but I feel like I’m getting the hang of them now. Stack views can be inside of other stack views and it can get tricky, but there are plenty of resources out there to help you. I feel like for some people the UI is more difficult than the actual code behind the UI. I can definitely understand that now, but these are just growing pains and I’m glad that I’m having them because I know it’s growing in the right direction. This was just a brief overview of Auto-Layout, more to come later.

这些可能会令人困惑,有时我会对它们感到沮丧,但是我感觉我现在已经掌握了这些建议。 堆栈视图可以位于其他堆栈视图内部,并且可能会很棘手,但是有大量资源可以帮助您。 我觉得对于某些人而言,UI比其背后的实际代码难得多。 我现在绝对可以理解,但是这些只是痛苦而已,我很高兴我能忍受这些痛苦,因为我知道它正在朝着正确的方向发展。 这只是“自动版式”的简要概述,以后还会介绍更多。

Rick Martinez

里克·马丁内斯(Rick Martinez)

翻译自: https://medium.com/@goodground1611/ios-dev-academy-short-takeaway-auto-layout-bf0861ee0ecf

ios dev关闭双重认证

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值