1. 首页
  2. 移动开发
  3. iOS
  4. iOS Auto Layout开发秘籍(第2版)

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

上传者: 2018-12-25 13:04:25上传 PDF文件 15.29MB 热度 31次
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).
用户评论