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
Copy file name to clipboardExpand all lines: README.md
+19-6Lines changed: 19 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ Flexbox is an incredible improvement over UIStackView. It is simpler to use, muc
23
23
24
24
25
25
### Requirements
26
-
* iOS 8.0+
26
+
* iOS 9.0+
27
27
* Xcode 8.0+ / Xcode 9.0
28
28
* Swift 3.0+ / Swift 4.0
29
29
@@ -637,10 +637,12 @@ For example, if all items have `grow` set to 1, every child will set to an equal
637
637
638
638
***`shrink(_: CGFloat)`**
639
639
It specifies the "flex shrink factor", which determines how much the flex item will shrink relative to the rest of the flex items in the flex container when there isn't enough space on the main-axis.
640
-
640
+
641
641
When omitted, it isset to 0 and the flex shrink factor is multiplied by the flex `basis` when distributing negative space.
642
642
643
643
A shrink value of0 keeps the view's size in the main-axis direction. Note that this may cause the view to overflow its flex container.
644
+
645
+
Shrink is about proportions. If an item has a shrink of3, and the rest have a shrink of1, the item will shrink 3xas fast as the rest.
644
646
645
647
<br>
646
648
@@ -781,8 +783,12 @@ FlexLayout has methods to set the view’s height and width.
781
783
782
784
***`width(_ width: CGFloat)`**
783
785
The value specifies the view's width in pixels. The value must be non-negative.
786
+
***`width(_ percent: FPercent)`**
787
+
The value specifies the view's width in percentage of its container width. The value must be non-negative.
784
788
***`height(_ height: CGFloat)`**
785
789
The value specifies the view's height in pixels. The value must be non-negative.
790
+
***`height(_ percent: FPercent)`**
791
+
The value specifies the view's height in percentage of its container height. The value must be non-negative.
786
792
***`size(_ size: CGSize)`**
787
793
The value specifies view's width and the height in pixels. Values must be non-negative.
788
794
***`size(_ sideLength: CGFloat)`**
@@ -792,6 +798,7 @@ The value specifies the width and the height of the view in pixels, creating a s
792
798
###### Usage examples:
793
799
```swift
794
800
view.flex.width(100)
801
+
view.flex.width(50%)
795
802
view.flex.height(200)
796
803
797
804
view.flex.size(250)
@@ -815,23 +822,29 @@ Another case where Min and Max dimension constraints are useful is when using `a
815
822
816
823
***`minWidth(_ width: CGFloat)`**
817
824
The value specifies the view's minimum width of the view in pixels. The value must be non-negative.
818
-
825
+
***`minWidth(_ percent: FPercent)`**
826
+
The value specifies the view's minimum width of the view in percentage of its container width. The value must be non-negative.
819
827
***`maxWidth(_ width: CGFloat)`**
820
828
The value specifies the view's maximum width of the view in pixels. The value must be non-negative.
821
-
829
+
***`maxWidth(_ percent: FPercent)`**
830
+
The value specifies the view's maximum width of the view in percentage of its container width. The value must be non-negative.
822
831
***`minHeight(_ height: CGFloat)`**
823
832
The value specifies the view's minimum height of the view in pixels. The value must be non-negative.
824
-
833
+
***`minHeight(_ percent: FPercent)`**
834
+
The value specifies the view's minimum height of the view in percentage of its container height. The value must be non-negative.
825
835
***`maxHeight(_ height: CGFloat)`**
826
836
The value specifies the view's maximum height of the view in pixels. The value must be non-negative.
837
+
***`maxHeight(_ percent: FPercent)`**
838
+
The value specifies the view's maximum height of the view in percentage of its container height. The value must be non-negative.
0 commit comments