![]() Their horizontal guides are 0 (zero), 20 and 10 respectively. Suppose we have three views (A, B and C). To continue explaining the concept, let’s explore horizontal alignments first. ![]() Note that alignments can be vertical or horizontal. It sets a point in a view, that determines how to position it in relation to the rest of its siblings. What Is an Alignment GuideĪn alignment guide is basically a numeric value. It will let you see visually what happens during alignment.īy the end of this post, you should be confident about what can and cannot be done with alignment guides. The code included, will also serve as a learning app. ![]() In this article, I will try to remove all the confusion around the topic, so we know exactly what to expect and how to get the results we want. If you remember one thing from this article, it should be this: EVERY VIEW inside a container, has an alignment guide. When we ignore them, things do not go our way. This confusion comes from not realizing there’s a whole set of implicit alignment guides in effect. However, there’s confusion about what we expect from them. Since we are in the early stages of SwiftUI, you may think… bah! just another bug, disregard and move to something else.Īfter spending some time testing the limits of alignment guides, I arrived at the conclusion that they do work. They tend to do what you expect them to do, until they don’t. If you ever tried using alignment guides though, chances are, you may have been puzzled by the results.
0 Comments
Leave a Reply. |