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
+27-18Lines changed: 27 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,17 +99,29 @@ PinLayout can position a view’s edge relative to its superview edges.
99
99
**Methods**:
100
100
101
101
*`top(_ value: CGFloat)`
102
-
The value specifies the distance in pixels between the top edge of the view and the top edge of its to superview
102
+
The value specifies the top edge distance from the superview's top edge in pixels.
103
+
*`top(_ percent: Percent)`
104
+
The value specifies the top edge distance from the superview's top edge in percentage of its superview's height.
103
105
*`left(_ value: CGFloat)`
104
-
The value specifies the distance in pixels between the left edge of the view and the left edge of its to superview
106
+
The value specifies the left edge distance from the superview's left edge in pixels.
107
+
*`left(_ percent: Percent)`
108
+
The value specifies the left edge distance from the superview's left edge in percentage of its superview's width.
105
109
*`bottom(_ value: CGFloat)`
106
-
The value specifies the distance in pixels between the bottom edge of the view and the bottom edge of its to superview.
110
+
The value specifies the bottom edge distance from the superview's bottom edge in pixels.
111
+
*`bottom(_ percent: Percent)`
112
+
The value specifies the bottom edge distance from the superview's bottom edge in percentage of its superview's height.
107
113
*`right(_ value: CGFloat)`
108
-
The value specifies the distance in pixels between the right edge of the view and the right edge of its to superview.
114
+
The value specifies the right edge distance from the superview's right edge in pixels.
115
+
*`right(_ percent: Percent)`
116
+
The value specifies the right edge distance from the superview's right edge in percentage of its superview's width.
109
117
*`hCenter(_ value: CGFloat)`
110
-
The value specifies the distance in pixels between the horizontal center of the view and the left edge of its to superview.
118
+
The value specifies the horizontal center distance from the superview's left edge in pixels.
119
+
*`hCenter(_ percent: Percent)`
120
+
The value specifies the horizontal center distance from the superview's left edge in percentage of its superview's width.
111
121
*`vCenter(_ value: CGFloat)`
112
-
The value specifies the distance in pixels between the vertical center of the view and the top edge of its to superview.
122
+
The value specifies the vertical center distance from the superview's top edge in pixels.
123
+
*`vCenter(_ percent: Percent)`
124
+
The value specifies the vertical center distance from the superview's top edge in percentage of its superview's height.
113
125
114
126
###### Usage Examples:
115
127
@@ -148,13 +160,10 @@ Position the view left edge directly on its superview top edge. Similar to calli
148
160
Position the view bottom edge directly on its superview top edge. Similar to calling bottom(0)
149
161
*`right()`
150
162
Position the view right edge directly on its superview top edge. Similar to calling right(0)
151
-
152
-
*`allEdges()`
153
-
Position
154
-
*`verticalEdges()`
155
-
Position
156
-
*`horizontalEdges()`
157
-
Position
163
+
*`hCenter()`
164
+
Position the view horizontal center directly on its superview horizontal center. Similar to calling hCenter(0).
165
+
*`vCenter()`
166
+
Position the view vertical center directly on its superview vertical center. Similar to calling vCenter(0).
158
167
159
168
###### Usage examples:
160
169
```javascript
@@ -421,24 +430,24 @@ PinLayout have methods to set the view’s height and width.
421
430
422
431
**Methods:**
423
432
424
-
*`width(percent: Percent)`
425
-
The value specifies the width of the view in percent relative to its superview (container). Value must be non-negative.
426
433
*`width(_ width: CGFloat)`
427
434
The value specifies the width of the view in pixels. Value must be non-negative.
435
+
*`width(percent: Percent)`
436
+
The value specifies the width of the view in percentage of its superview. Value must be non-negative.
428
437
*`width(of view: UIView)`
429
438
Set the view’s width to match the referenced view’s width.
430
439
431
-
*`height(percent: Percent)`
432
-
The value specifies the height of the view in percent relative to its superview (container). Value must be non-negative.
433
440
*`height(_ height: CGFloat)`
434
441
The value specifies the height of the view in pixels.
442
+
*`height(percent: Percent)`
443
+
The value specifies the height of the view in percentage of its superview. Value must be non-negative.
435
444
*`height(of view: UIView)`
436
445
Set the view’s height to match the referenced view’s height
437
446
438
447
*`size(_ size: CGSize)`
439
448
The value specifies the size (width and value) of the view in pixels. Values must be non-negative.
440
449
*`size(_ percent: Percent)`
441
-
The value specifies the width and the height of the view in percent relative to its superview (container), creating a square view. Values must be non-negative.
450
+
The value specifies the width and the height of the view in percentage of its superview. Values must be non-negative.
442
451
*`size(_ sideLength: CGFloat)`
443
452
The value specifies the width and the height of the view in pixels, creating a square view. Values must be non-negative.
0 commit comments