Skip to content

Commit 0a2d8a1

Browse files
author
欧柏泉
committed
Release V1.5.0
1 parent ef03588 commit 0a2d8a1

File tree

4 files changed

+58
-58
lines changed

4 files changed

+58
-58
lines changed

CHANGELOG.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#### Added
99
1. 添加新的布局种类:**栅格布局(MyGridLayout)**。栅格布局是一种将矩形区域划分为多个子矩形区域,并将这个划分一直持续下去的机制,然后再将子视图填充到对应的栅格区域里面的一种布局视图。栅格布局特别适合于动态布局,布局样式可以从服务器动态下发,并且可以用JSON格式的语言来描述这种布局结构,具体请参考新增加的栅格布局和对应的DEMO。以及对应的说明文档:[栅格布局介绍](http://bicyclering.com/2017/09/01/layout/)
1010
2. 添加了对**基线对齐baseline**的支持[issue:#43](https://github.com/youngsoft/MyLinearLayout/issues/43),目前只有**水平线性布局(MyLinearLayout)****相对布局(MyRelativeLayout)**支持基线对齐。
11-
1. 在**MyGravity**中添加了`MyGravity_Vert_Baseline`的枚举定义来支持线性布局的基线对齐,并且在线性布局中添加了一个属性:`baselineBaseView`来指定某个基线基准视图。同时在布局视图的gravity属性中支持对`MyGravity_Vert_Baseline`的设置。具体例子参考:[LLTest1ViewController](https://github.com/youngsoft/MyLinearLayout/blob/master/MyLayout/LLTest1ViewController.m)
11+
1.**MyGravity**中添加了`MyGravity_Vert_Baseline`的枚举定义来支持线性布局的基线对齐,并且在线性布局中添加了一个属性:`baselineBaseView`来指定某个基线基准视图。同时在布局视图的gravity属性中支持对`MyGravity_Vert_Baseline`的设置。具体例子参考:[LLTest1ViewController](https://github.com/youngsoft/MyLinearLayout/blob/master/MyLayout/LLTest1ViewController.m)
1212

13-
2. 在UIView的扩展属性中增加了一个扩展属性:`baselinePos`。你可以在相对布局中的子视图使用这个属性来进行基线对齐的设置。具体例子请参考:[RLTest1ViewController](https://github.com/youngsoft/MyLinearLayout/blob/master/MyLayout/RLTest1ViewController.m)
13+
2. 在UIView的扩展属性中增加了一个扩展属性:`baselinePos`。你可以在相对布局中的子视图使用这个属性来进行基线对齐的设置。具体例子请参考:[RLTest1ViewController](https://github.com/youngsoft/MyLinearLayout/blob/master/MyLayout/RLTest1ViewController.m)
1414

1515
3. 添加对Apple TV_OS 的支持,您可以用MyLayout来开发apple TV方面的应用。
1616
4. **MyLayoutPos**中增加了一个特殊的值`safeAreaMargin`用来支持对iOS11应用的适配。
@@ -137,7 +137,7 @@ MyBaseLayout|trailingBorderline|rightBorderline|leftBorderline
137137
MyGravity|MyGravity_Horz_Leading|MyGravity_Horz_Left|MyGravity_Horz_Right
138138
MyGravity|MyGravity_Horz_Trailing|MyGravity_Horz_Right|MyGravity_Horz_Left
139139

140-
如果您的界面布局不需要考虑RTL以及对阿拉伯国际的支持则不需要使用上述新添加的属性。
140+
如果您的界面布局不需要考虑RTL以及对阿拉伯国际的支持则不需要使用上述新添加的属性。
141141

142142
2. 添加了UIView扩展新属性`wrapContentSize`用来简化对`wrapContentHeight和wrapContentWidth`的设置。这个属性尤其对`UILabel`有用,表示视图的尺寸由内容自适用。
143143
3. 实现了对UILabel的`text``attributedText`进行设置后自动布局的功能,老版本的代码中每次设置完毕text值后要调用一下sizeToFit来激发布局,新版本自动添加了这个功能,使得不需要明确调用sizeToFit了。但是这样的前提是您必须对UILabel设置了wrapContentHeight或者wrapContentWidth。
@@ -163,10 +163,10 @@ MyAdjustScrollViewContentSizeMode|MyAdjustScrollViewContentSizeModeAuto|MyLayout
163163
MyAdjustScrollViewContentSizeMode|MyAdjustScrollViewContentSizeModeNo|MyLayoutAdjustScrollViewContentSizeModeNo
164164
MyAdjustScrollViewContentSizeMode|MyAdjustScrollViewContentSizeModeYes|MyLayoutAdjustScrollViewContentSizeModeYes
165165

166-
如果您要替换掉所有老方法和属性(建议替换),则您可以按照如下步骤来完成代码的替换工作:
166+
如果您要替换掉所有老方法和属性(建议替换),则您可以按照如下步骤来完成代码的替换工作:
167167

168-
1. 查找所有:MyLayoutViewOrientation_ 并替换为MyOrientation_ (选择Containning, 查找后选择preview,然后把除MyLayout库之外的其他都替换掉)
169-
2. 查找所有:MyLayoutAdjustScrollViewContentSizeMode 并替换为MyAdjustScrollViewContentSizeMode (选择Containning, 查找后选择preview,然后把除MyLayout库之外的其他都替换掉)
168+
1. 查找所有:MyLayoutViewOrientation_ 并替换为MyOrientation_ (选择Containning, 查找后选择preview,然后把除MyLayout库之外的其他都替换掉)
169+
2. 查找所有:MyLayoutAdjustScrollViewContentSizeMode 并替换为MyAdjustScrollViewContentSizeMode (选择Containning, 查找后选择preview,然后把除MyLayout库之外的其他都替换掉)
170170

171171

172172
2. 新版本优化了布局库的子视图构建性能和布局性能。下面表格是新旧版本各布局视图内单个子视图在iPhone6真机设备下的构建和布局时长值(单位是毫秒ms)
@@ -181,9 +181,9 @@ MyFloatLayout|0.148|0.147|-0.48%||0.055|0.117|113%
181181
MyTableLayout\*|||
182182
MyPathLayout\*|||
183183

184-
这里没有提供表格布局和路径布局数据是因为表格布局就是一种线性套线性的线性布局,路径布局则没有进行多少优化。下面的一个表格则是单个视图分别在MyLayout,frame,AutoLayout,Masonry,UIStackView5种布局体系下的构建和布局时长对比值。
185-
186-
create time|Frame|MyLayout|AutoLayout|Masonry|UIStackView
184+
这里没有提供表格布局和路径布局数据是因为表格布局就是一种线性套线性的线性布局,路径布局则没有进行多少优化。下面的一个表格则是单个视图分别在MyLayout,frame,AutoLayout,Masonry,UIStackView5种布局体系下的构建和布局时长对比值。
185+
186+
create time|Frame|MyLayout|AutoLayout|Masonry|UIStackView
187187
-------|-----|------|---------|----------|-----
188188
MyLinearLayout|0.08|0.164|0.219|0.304|0.131
189189
MyFrameLayout|0.05|0.149|0.209|0.273|0.131
@@ -193,7 +193,7 @@ MyFloatLayout|0.044|0.148|0.203|0.250|0.131
193193

194194

195195

196-
layout time |Frame|MyLayout|AutoLayout|Masonry|UIStackView
196+
layout time |Frame|MyLayout|AutoLayout|Masonry|UIStackView
197197
-------|-----|-------|--------|--------|-------
198198
MyLinearLayout|0|0.049|0.269|0.269|0.272
199199
MyFrameLayout|0|0.042|0.243|0.243|0.272
@@ -266,10 +266,10 @@ MyTableLayout|colSpacing|subviewHSpace
266266
267267
如果您要替换掉所有老方法和属性(建议替换),则您可以按照如下步骤来完成代码的替换工作:
268268

269-
1. 查找所有:MyMarginGravity_ 并替换为MyGravity_ (选择Containning, 查找后选择preview,然后把除MyLayout库之外的其他都替换掉)
270-
2. 把所有.myLeftMargin, .myRightMargin, .myTopMargin, .myBottomMargin, .myCenterXOffset, .myCenterYOffset, .myCenterOffset 分别替换为.myLeft, .myRight, .myTop, .myBottom, .myCenterX, .myCenterY, .myCenter (选择Matching模式)
271-
3. 把所有.widthDime替换为.widthSize, .heightDime替换为.heightSize (选择Matching模式)
272-
4. 把所有.subviewMargin替换为.subviewSpace, .subviewVertMargin替换为.subviewVSpace, .subviewHorzMargin替换为.subviewHSpace (选择Matching模式)
269+
1. 查找所有:MyMarginGravity_ 并替换为MyGravity_ (选择Containning, 查找后选择preview,然后把除MyLayout库之外的其他都替换掉)
270+
2. 把所有.myLeftMargin, .myRightMargin, .myTopMargin, .myBottomMargin, .myCenterXOffset, .myCenterYOffset, .myCenterOffset 分别替换为.myLeft, .myRight, .myTop, .myBottom, .myCenterX, .myCenterY, .myCenter (选择Matching模式)
271+
3. 把所有.widthDime替换为.widthSize, .heightDime替换为.heightSize (选择Matching模式)
272+
4. 把所有.subviewMargin替换为.subviewSpace, .subviewVertMargin替换为.subviewVSpace, .subviewHorzMargin替换为.subviewHSpace (选择Matching模式)
273273
5. 把所有的MyBorderLineDraw替换为MyBorderline(选择Matching模式 并注意MyBaseLayout.h中的不要替换)
274274
6. 把.leftBorderLine替换为.leftBorderline, .rightBorderLine替换为.rightBorderline, .topBorderLine替换为.topBorderline, .bottomBorderLine替换为.bottomBorderline, .IntelligentBorderLine替换为.intelligentBorderline, .notUseIntelligentBorderLine替换为.notUseIntelligentBorderline(选择Matching模式)
275275
7. 把averageSubviews:方法替换为equalizeSubviews: 把averageMargin:替换为equalizeSubviewsSpace: (注意不要替换MyLinearLayout.h和MyLinearLayout.m中的部分)
@@ -553,15 +553,15 @@ MyTableLayout|colSpacing|subviewHSpace
553553
7. 修正了其他的BUG。
554554

555555
## [V1.1.1]
556-
1. 新增加了一个mySize属性可以设置布局的宽度和高度,相当于同时设置myWidth,myHeight
557-
2. 修正了和iOS的AutoLayout结合使用时可能出现的布局定位不正确的问题,这个版本可以同时和frame,AutoLayout布局进行混合使用。
558-
3. 修正了其他的小问题,以及注释进行了优化和完整。
559-
4. 将原来的leftMargin,rightMargin,topMargin,bottomMargin,width,height,centerXOffset,centerYOffset,centerOffset这几个方法进行了命名冲突兼容,新版本都在前面增加了my前缀,如果要保持老版本请定义宏:` #define MY_USEOLDMETHODDEF 1 `` #define MY_USEOLDMETHODNOWARNING 1 `
560-
5. 将原来的的MarginGravity枚举类型和LineViewOrientation枚举类型重新定义为:MyMarginGravity和MyLayoutViewOrientation。里面的枚举值也进行重新定义,但可以定义宏:` #define MY_USEOLDENUMDEF 1 `` #define MY_USEOLDENUMNOWARNING 1 `来兼容老版本。
556+
1. 新增加了一个mySize属性可以设置布局的宽度和高度,相当于同时设置myWidth,myHeight
557+
2. 修正了和iOS的AutoLayout结合使用时可能出现的布局定位不正确的问题,这个版本可以同时和frame,AutoLayout布局进行混合使用。
558+
3. 修正了其他的小问题,以及注释进行了优化和完整。
559+
4. 将原来的leftMargin,rightMargin,topMargin,bottomMargin,width,height,centerXOffset,centerYOffset,centerOffset这几个方法进行了命名冲突兼容,新版本都在前面增加了my前缀,如果要保持老版本请定义宏:` #define MY_USEOLDMETHODDEF 1 `` #define MY_USEOLDMETHODNOWARNING 1 `
560+
5. 将原来的的MarginGravity枚举类型和LineViewOrientation枚举类型重新定义为:MyMarginGravity和MyLayoutViewOrientation。里面的枚举值也进行重新定义,但可以定义宏:` #define MY_USEOLDENUMDEF 1 `` #define MY_USEOLDENUMNOWARNING 1 `来兼容老版本。
561561

562562

563563
## [V1.1.0]
564-
1. 增加了新布局流式布局MyFlowLayout。
564+
1. 增加了新布局流式布局MyFlowLayout。
565565
2. 线性布局添加了gravity停靠设置的屏幕水平居中和屏幕垂直居中的功能。
566566
3. 添加了设置布局视图背景图片backgroundImage和高亮背景图片highlightedBackgroundImage的功能。
567567
4. 添加了视图偏移约束的最大max最小值min限制,以及尺寸约束时的最大max最小值min限制。

MyLayout/Info.plist

+18-18
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>CFBundleDevelopmentRegion</key>
6-
<string>en</string>
7-
<key>CFBundleExecutable</key>
8-
<string>$(EXECUTABLE_NAME)</string>
9-
<key>CFBundleIdentifier</key>
10-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11-
<key>CFBundleInfoDictionaryVersion</key>
12-
<string>6.0</string>
13-
<key>CFBundleName</key>
14-
<string>$(PRODUCT_NAME)</string>
15-
<key>CFBundlePackageType</key>
16-
<string>FMWK</string>
17-
<key>CFBundleShortVersionString</key>
18-
<string>1.5.0</string>
19-
<key>CFBundleVersion</key>
20-
<string>$(CURRENT_PROJECT_VERSION)</string>
21-
<key>NSPrincipalClass</key>
22-
<string></string>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.5.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>$(CURRENT_PROJECT_VERSION)</string>
21+
<key>NSPrincipalClass</key>
22+
<string></string>
2323
</dict>
2424
</plist>

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -626,24 +626,24 @@ Then, run the following command:
626626
627627
1. Create a `Cartfile` file.
628628
629-
```
630-
github "youngsoft/MyLinearLayout"
631-
```
629+
```
630+
github "youngsoft/MyLinearLayout"
631+
```
632632
2. Run `carthage update`.
633633
634634
3. On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop `MyLayout` framework from the Carthage/Build folder on disk.
635635
636636
4. On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script in which you specify your shell (ex: bin/sh), add the following contents to the script area below the shell:
637637
638-
```
639-
/usr/local/bin/carthage copy-frameworks
640-
```
638+
```
639+
/usr/local/bin/carthage copy-frameworks
640+
```
641641
642-
and add the path under “Input Files”, e.g.:
642+
and add the path under “Input Files”, e.g.:
643643
644-
```
645-
$(SRCROOT)/Carthage/Build/iOS/MyLayout.framework
646-
```
644+
```
645+
$(SRCROOT)/Carthage/Build/iOS/MyLayout.framework
646+
```
647647
648648
649649

README.zh.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ MyLayout是一套iOS界面视图布局框架。MyLayout的内核是基于对UIVi
4343

4444
下面两张表格分别列表每个子视图的建立消耗的时间和布局消耗时间,单位为:毫秒
4545

46-
create time(ms)/per subview|Frame|MyLayout|AutoLayout|Masonry|UIStackView
46+
create time(ms)/per subview|Frame|MyLayout|AutoLayout|Masonry|UIStackView
4747
-------|-----|-------|--------|--------|-------
4848
MyLinearLayout|0.08|0.164|0.219|0.304|0.131
4949
MyFrameLayout|0.05|0.149|0.209|0.273|0.131
@@ -53,7 +53,7 @@ MyFloatLayout|0.044|0.148|0.203|0.250|0.131
5353

5454

5555

56-
layout time(ms)/per subview |Frame|MyLayout|AutoLayout|Masonry|UIStackView
56+
layout time(ms)/per subview |Frame|MyLayout|AutoLayout|Masonry|UIStackView
5757
-----|-------|--------|-------|---------|------
5858
MyLinearLayout|0|0.049|0.269|0.269|0.272
5959
MyFrameLayout|0|0.042|0.243|0.243|0.272
@@ -413,7 +413,7 @@ MyLayoutSize类是用来描述一个视图的尺寸的类。UIView中扩展出
413413
```
414414

415415

416-
416+
417417
### 浮动布局MyFloatLayout
418418
> 等价于css中的float定位。
419419
@@ -635,21 +635,21 @@ $ pod install
635635
636636
1.创建一个 `Cartfile` 文件,内容如下:
637637
638-
github "youngsoft/MyLinearLayout"
639-
638+
github "youngsoft/MyLinearLayout"
639+
640640
2.终端执行`carthage update`。
641641
642642
3.点击“General”按钮,然后把`Carthage/Build/iOS/MyLayout.framework`拖拽到到“Linked Frameworks and Libraries”栏目里。
643643
644644
4.点击“Build Phases”按钮, 然后点击左上角的加号 “+” 选择“New Run Script Phase”,在`Shell`下面填写下面内容:
645645
646-
/usr/local/bin/carthage copy-frameworks
647-
646+
/usr/local/bin/carthage copy-frameworks
647+
648648
然后在 “Input Files”栏目加上:
649649
650-
651-
$(SRCROOT)/Carthage/Build/iOS/MyLayout.framework
652-
650+
651+
$(SRCROOT)/Carthage/Build/iOS/MyLayout.framework
652+
653653
654654
655655

0 commit comments

Comments
 (0)