Join Scott Gardner for an in-depth discussion in this video Layers, part of iOS UI Development with Visual Tools.
- [Voiceover] Every view has a backing layer that is used to manage visual content. However, layers can also be created independently as stand-alone objects and added as sublayers to other layers in code, much in the same way that you would add subviews. Working with layers, you can manipulate properties of visual content such as a view to set its foreground and, or background colors, create a border and set its thickness, color, and corner radius, that is, the roundedness of the corners. You can add and stylize a drop shadow effect, and you can mask the visual content, which is necessary when setting the corner radius to round the corners.
You can adjust a layer's positioning along the x, y, and z-axes, that is x is horizontal, y is vertical, and z is the front-to-back ordering. And you can transform and animate layers, and more typically, a view, by manipulating its backing layer. I'm going to take advantage of layers in the remainder of this chapter to create visual content that can be stylized in the storyboard where the changes will be rendered in real time.
Here iOS app architect Scott Gardner explains how to create designable views and dynamic and adaptive user interfaces for any screen size or orientation. He shows how to work with stack views, images, custom fonts, and Interface Builder's Auto Layout tools, which speed up your design process and help adhere to Apple's interface guidelines. Along the way, he provides best practices for designing interfaces that are clean, efficient, and enjoyable for users.
- Creating and customizing views
- Laying out a user interface
- Working with dynamic Auto Layout designs
- Stacking views
- Creating an adaptive layout
- Handling orientation changes
- Working with images
- Customizing fonts