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
:pushpin: PinLayout is actively updated, adding more features weekly. So please come often to see latest changes. You can also **Star** it to be able to retrieve it easily later.
@@ -127,10 +130,10 @@ This example layout an image, a UISegmentedControl, a label and a line separator
:pushpin: minWidth/maxWidth & minHeight/maxHeight have the highest priority. Higher than width/height/size, edges and anchors positionning. Their values are always respected.
609
+
PinLayout has methods to set the view’s minimum and maximum width, and minimum and maximum height.
The value specifies the view's maximum height of the view in pixels or in percentage of its superview. Value must be non-negative.
624
+
625
+
###### Usage examples:
626
+
```swift
627
+
view.pin.left(10).right(10).maxWidth(200)
628
+
view.pin.width(100%).maxWidth(250)
629
+
630
+
view.pin.top().bottom().maxHeight(100)
631
+
view.pin.top().height(50%).maxHeight(200)
632
+
```
633
+
634
+
:pushpin: minWidth/maxWidth & minHeight/maxHeight have the highest priority. Higher than sizes (width/height/size) and edges positionning (top/left/bottom/right). Their values are always fullfilled.
614
635
615
636
637
+
###### Example:
638
+
This example layout a view 20 pixels from the top, and horizontally from left to right with a maximum width of 200 pixels. If the superview is smaller than 200 pixels, the view will take the full horizontal space, but for a larger superview, the view will be centered.
Justify the view horizontally. This method justify horizontally a view in situations where the left, right and the width has been set (using either width/minWidth/maxWidth). In this situation the view may be smaller than the space available between the left and the right edges. A view can be justified **left**, **center** or **right**.
661
+
662
+
*`align(_ : VerticalAlign)`
663
+
Align the view vertically. This method align vertically a view in situations where the top, bottom and the height has been set (using either height/minHeight/maxHeight). In this situation the view may be smaller than the space available between the top and the bottom edges. A view can be aligned **top**, **center** or **bottom**.
This example layout a view between its superview left and right edges with a maximum size of 200 pixels. Without the usage of the `justify(:HorizontalAlign)` method, the view will be justified on the left:
0 commit comments