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: MyLayout.podspec
+3-3
Original file line number
Diff line number
Diff line change
@@ -16,8 +16,8 @@ Pod::Spec.new do |s|
16
16
#
17
17
18
18
s.name="MyLayout"
19
-
s.version="1.2.7"
20
-
s.summary="MyLayout is A powerful iOS UI framework. It integrated the Android layout,AutoLayout,SizeClass, HTML/CSS float and flexbox functions."
19
+
s.version="1.2.8"
20
+
s.summary="MyLayout is a powerful iOS UI framework. It integrated the Android layout,AutoLayout,SizeClass, HTML/CSS float and flexbox functions."
21
21
22
22
s.description=<<-DESC
23
23
*MyLayout is a powerful iOS UI layout framework which is not an encapsulation based on the AutoLayout but is based on primary frame property and by overwriting the layoutSubview method to realize the subview's layout.
MyLayout is a simple and easy objective-c framework for iOS view layout. MyLayout provides some simple functions to build a variety of complex interface. It integrates the functions including: Autolayout and SizeClass of iOS, five layout classes of Android, float and flex-box and bootstrap of HTML/CSS. The MyLayout's Swift version are named: **[TangramKit](https://github.com/youngsoft/TangramKit)**
11
12
12
-
## Introduction
13
-
---
14
-
**MyLayout is a powerful iOS UI layout framework which is not an encapsulation based on the AutoLayout but is based on primary *frame* property and by overwriting the *layoutSubview* method to realize the subview's layout. So It is unlimited to run in any version of iOS system. Its idea and principle is referenced from the layout of the Android system, HTML/CSS float&flexbox, iOS AutoLayout and SizeClass. You can implement the UI layout through the seven kinds of layout class below: MyLinearLayout, MyRelativeLayout, MyFrameLayout MyTableLayout, MyFlowLayout,MyFloatLayout ,MyPathLayout and the support for SizeClass.**
13
+
#####  Chinese (Simplified): [中文说明](README.zh.md)
15
14
16
-
**Powerful function, easy to use, barely constraint
17
-
setting and fit various screen size perfectly are MyLayout's main advantages.**
18
15
19
-
**I hope you use MyLayout right now or in your next project will be happy!**
20
16
21
-
#### MyLayout's Swift version are named:[TangramKit](https://github.com/youngsoft/TangramKit)
17
+
## Usage
18
+
19
+
* There is a container view S which width is 100 and height is wrap to all subviews height. there are four subviews A,B,C,D arranged from top to bottom.
20
+
* Subview A's left margin is 20% width of S, right margin is 30% width of S, height is equal to width of A.
21
+
* Subview B's left margin is 40, width is filled in to residual width of S,height is 40.
22
+
* Subview C's width is filled in to S, height is 40.
23
+
* Subview D's right margin is 20, width is 50% width of S, height is 40
`MyLayoutPos` is represent to the position of a view. UIView provides six extension variables:leftPos, topPos, bottomPos, rightPos, centerXPos, centerYPos to set view's margin or space distance between self and others. You can use `equalTo` method to set NSNumber or MyLayoutPos or NSArray<MyLayoutPos*> value. there are six simple variables:myLeftMargin,myTopMargin,myBottomMargin,myRightMargin,myCenterXOffset,myCenterYOffset use to set NSNumber value. eg. `A.leftPos.equalTo(@10); <==> A.myLeftMargin = 10;`
67
+
68
+
69
+
###MyLayoutSize
70
+
`MyLayoutSize` is represent to the size of a view. UIView provides two extension variables:widthDime,heightDime to set view's width and height dimension. You can use `equalTo` method to set NSNumber or MyLayoutSize or NSArray<MyLayoutSize*> value. there are two simple variables: myWidth, myHeight use to set NSNumber value. eg. `A.widthDime.equalTo(@10); <==> A.myWidth = 10;`
Linear layout is a single line layout view that the subviews are arranged in sequence according to the added order(from top to bottom or from left to right). So the subviews' origin&size constraints are established by the added order. Subviews arranged in top-to-bottom order is called vertical linear layout view, and
28
75
the subviews arranged in left-to-right order is called horizontal linear layout.
@@ -59,9 +106,7 @@ D.myHeight = 40;
59
106
60
107
```
61
108
62
-
**MyLinearLayout be equivalent to LinearLayout of Android and UIStackView**
63
109
64
-
---
65
110
### MyRelativeLayout
66
111
Relative layout is a layout view that the subviews layout and position through mutual constraints.The subviews in the relative layout are not depended to the adding order but layout and position by setting the subviews' constraints.
**MyRelativeLayout be equivalent to RelativeLayout of Android and AutoLayout**
113
157
114
-
---
158
+
115
159
### MyFrameLayout
116
160
Frame layout is a layout view that the subviews can be overlapped and gravity in a special location of the superview.The subviews' layout position&size is not depended to the adding order and establish dependency constraint with the superview. Frame layout devided the vertical orientation to top,vertical center and bottom, while horizontal orientation is devided to left,horizontal center and right. Any of the subviews is just gravity in either vertical orientation or horizontal orientation.
117
161
@@ -147,9 +191,7 @@ Sample code:
147
191
148
192
```
149
193
150
-
**MyFrameLayout be equivalent to FrameLayout of Android**
151
194
152
-
---
153
195
### MyTableLayout
154
196
Table layout is a layout view that the subviews are multi-row&col arranged like a table. First you must create a rowview and add it to the table layout, then add the subview to the rowview. If the rowviews arranged in top-to-bottom order,the tableview is caled vertical table layout,in which the subviews are arranged from left to right; If the rowviews arranged in in left-to-right order,the tableview is caled horizontal table layout,in which the subviews are arranged from top to bottom.
155
197
@@ -186,9 +228,6 @@ Sample code:
186
228
187
229
```
188
230
189
-
**MyTableLayout be equivalent to TableLayout of Android and table element of HTML**
190
-
191
-
---
192
231
193
232
### MyFlowLayout
194
233
Flow layout is a layout view presents in multi-line that the subviews are arranged in sequence according to the added order, and when meeting with a arranging constraint it will start a new line and rearrange. The constrains mentioned here includes count constraints and size constraints. The orientation of the new line would be vertical and horizontal, so the flow layout is divided into: count constraints vertical flow layout, size constraints vertical flow layout, count constraints horizontal flow layout, size constraints horizontal flow layout. Flow layout often used in the scenes that the subviews is arranged regularly, it can be substitutive of UICollectionView to some extent. the MyFlowLayout is almost implement the flex-box function of the HTML/CSS.
@@ -198,7 +237,7 @@ Flow layout is a layout view presents in multi-line that the subviews are arrang
Float layout is a layout view that the subviews are floating gravity in the given orientations, when the size is not enough to be hold, it will automatically find the best location to gravity. float layout's conception is reference from the HTML/CSS's floating positioning technology, so the float layout can be designed in implementing irregular layout. According to the different orientation of the floating, float layout can be divided into left-right float layout and up-down float layout.
223
261
@@ -258,9 +296,7 @@ Sample code:
258
296
259
297
```
260
298
261
-
**MyFloatLayout be equivalent to float of CSS**
262
299
263
-
---
264
300
### MyPathLayout
265
301
Path layout is a layout view that the subviews are according to a specified path curve to layout. You must provide a type of Functional equation,a coordinate and a type of distance setting to create a Path Curve than all subview are equidistance layout in the Path layout. path layout usually used to create some irregular and gorgeous UI layout.
266
302
@@ -287,17 +323,14 @@ Sample code:
287
323
288
324
```
289
325
290
-
**MyPathLayout is only implement in MyLayout**
291
-
292
-
---
326
+
327
+
293
328
### MySizeClass
294
329
MyLayout provided support to SizeClass in order to fit the different screen sizes of devices. You can combinate the SizeClass with any of the 6 kinds of layout views mentioned above to perfect fit the UI of all equipments.
[Download MyLayout](https://github.com/youngsoft/MyLinearLayout/archive/master.zip) and try out the included iPad and iPhone example apps
315
347
Read FAQ, or articles below:
316
348
@@ -326,7 +358,7 @@ Because my english is poor so I just only can support chinese articles,and I w
326
358
327
359
328
360
##Communication
329
-
---
361
+
330
362
331
363
- If you need help, use Stack Overflow or Baidu. (Tag 'mylayout')
332
364
- If you'd like to contact me, use *qq:156355113 or weibo:欧阳大哥 or email:obq0387_cn@sina.com*
@@ -335,7 +367,7 @@ Because my english is poor so I just only can support chinese articles,and I w
335
367
- If you want to contribute, submit a pull request.
336
368
337
369
## Installation
338
-
---
370
+
339
371
MyLayout supports multiple methods for installing the library in a project.
340
372
### Copy to your project
341
373
1. Copy `Lib` folder from the demo project to your project
@@ -353,7 +385,7 @@ To integrate MyLayout into your Xcode project using CocoaPods, specify it in you
353
385
source 'https://github.com/CocoaPods/Specs.git'
354
386
platform :ios, '7.0'
355
387
356
-
pod 'MyLayout', '~> 1.2.7'
388
+
pod 'MyLayout', '~> 1.2.8'
357
389
```
358
390
359
391
Then, run the following command:
@@ -365,7 +397,7 @@ Then, run the following command:
365
397
366
398
367
399
##FAQ
368
-
---
400
+
369
401
* If you use MyLayout runtime cause 100% CPU usage said appeared constraint conflict, please check the subview's constraint set.
370
402
* If you use MyLayout exception crashed in MyBaseLayout *willMoveToSuperview* method. it does not matter, just remove the exception break setting in CMD+7.
371
403
* If you set wrapConentWidth or wrapContentHeight while set widthDime or heightDime in layout view may be constraint conflict。
@@ -375,7 +407,6 @@ Then, run the following command:
375
407
376
408
377
409
## License
378
-
---
379
410
380
411
MyLayout is released under the MIT license. See LICENSE for details.
0 commit comments