You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -778,25 +778,32 @@ Item natural size, considering only properties of the view itself. Independent o
778
778
779
779
<br>
780
780
781
-
<aname="absolute_positioning"></a>
782
-
## 4. Absolute positioning
781
+
<aname="positioning"></a>
782
+
## 4. Positioning
783
783
- Applies to: `flex items`
784
784
- Parameter: CGFloat
785
785
786
786
**Method:**
787
787
788
788
***`position(_: Position)`**
789
789
The position property tells Flexbox how you want your item to be positioned within its parent. Position values:
790
-
***`relative (default)`**
791
-
***`absolute`**: The view is positioned using properties: top(), bottom(), left(), right(), start(), end().
790
+
***`relative (default)`** The view is positioned using Insets properties (top, bottom, left, right, start, end) from its normal position within its flex container and will take up space within the flex container. This node will always form a containing block.
791
+
***`absolute`**: The view is removed from the flex container's flow and is positioned using Insets properties (top, bottom, left, right, start, end). Insets will offset the node from its containing block.
792
+
***`static`**: The view ignores insets and will not form a containing block.
A flex item which is `position` is set to `.absolute` is positioned absolutely in regards to its parent. This is done through the following methods:
802
+
A flex item with position set to .relative is positioned relative to its normal position within its flex container. Only one property can be applied in each direction, either vertical or horizontal. If both `top` and `bottom` properties are set, `top` takes precedence. If both `left` and `right` properties are set, `left` takes precedence.
803
+
804
+
A flex item with position set to .absolute is positioned absolutely with respect to its containing block. Using these properties you can control the size and position of an absolute item within its parent. Because absolutely positioned children don’t affect their sibling's layout. Absolute position can be used to create overlays and stack children in the Z axis.
805
+
806
+
This is done through the following methods:
800
807
801
808
**Methods:**
802
809
@@ -819,10 +826,10 @@ Controls the distance child’s left and right edges from the parent’s edges.
819
826
***`all(: CGFloat)`** / **`all(: FPercent)`**:
820
827
Controls the distance child’s edges from the parent’s edges. Equal to `top().bottom().left().right()`.
821
828
822
-
Using these properties you can control the size and position of an absolute item within its parent. Because absolutely positioned children don’t affect their sibling's layout. Absolute position can be used to create overlays and stack children in the Z axis.
0 commit comments