iOS Auto Layout开发秘籍(第2版)

时间:2021-04-28 04:50:37
【文件属性】:

文件名称:iOS Auto Layout开发秘籍(第2版)

文件大小:15.29MB

文件格式:PDF

更新时间:2021-04-28 04:50:37

ios

There are many reasons developers want to say “No” to Auto Layout. Maybe it’s too new, too strange, or requires a bit of work to update interfaces. But you should say “Yes.” Auto Layout revolutionizes view layout with something wonderful, fresh, and new. Apple’s layout features make your life easier and your interfaces more consistent, and they add resolution-independent placement for free. You get all this, regardless of device geometry, orientation, and window size. Auto Layout works by creating relationships between onscreen objects. It specifies the way the runtime system automatically arranges your views. The outcome is a set of robust rules that adapt to screen and window geometry. With Auto Layout, you describe constraints that specify how views relate to one another, and you set view properties that describe a view’s relationship to its content. With Auto Layout, you can make requests such as the following: ■ Match one view’s size to another view’s size so that they always remain the same width. ■ Center a view (or even a group of views) in a superview, no matter how much the superview reshapes. ■ Align the bottoms of several views while laying out a row of items. ■ Offset a pair of items by some constant distance (for example, adding a standard 8-point padding space between views).


网友评论