Skip to content

Commit c0ae5c4

Browse files
author
@欧柏泉
committed
Release V1.3.1
1 parent ac603e8 commit c0ae5c4

23 files changed

+669
-197
lines changed

CHANGELOG.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33

44
---
55

6+
## [V1.3.1](https://github.com/youngsoft/MyLinearLayout/releases/tag/1.3.1)(2016/12/28)
7+
8+
#### Added
9+
1. 布局位置类`MyLayoutPos`和布局尺寸类`MyLayoutSize`类中添加了新属性:`active`.用来描述指定的位置或者尺寸所设置的约束是否有效。
10+
2. 添加了Demo:ALLTest8ViewController这个例子专门用来演示把一个布局视图加入到非布局父视图时的使用方法。
11+
12+
#### Fixed
13+
1. 修正了将一个具有`wrapContentWidth`或者`wrapContentHeight`属性设置的布局视图加入到非布局父视图时,且又设置centerXPos,centerYPos,rightPos,bottomPos来定位布局视图时无法正确定位布局视图位置的BUG。
14+
15+
#### Changed
16+
1. 修改了将布局视图加入`UIScrollView`时会自动调整`UIScrollView``contentSize`的机制,新的机制中布局视图设置的`MyLayoutPos`边距值也会算到contentSize里面去。比如某个布局的高度是100,其中的myTopMargin = 10, 那么当将布局视图加入到UIScrollView时他的contentSize的高度则是110.
17+
18+
619
## [V1.3.0](https://github.com/youngsoft/MyLinearLayout/releases/tag/1.3.0)(2016/12/21)
720

821
#### Added
@@ -12,7 +25,7 @@
1225
#### Fixed
1326
1. 修复路径布局`MyPathLayout`中设置`wrapContentWidth``wrapContentHeight`为YES时的计算错误的情况。
1427
2. 修复线性布局`MyLinearLayout`里面均分间距和均分视图两个方法可能导致均分不正确的BUG。
15-
3. 修复了相对布局`MyRelativeLayout`中如果设置了`topPadding`而子视图的`topPos`设置为数值时`topPadding`不起作用的BUG
28+
3. 修复了相对布局`MyRelativeLayout`中如果设置了`topPadding`而子视图的`topPos`设置为数值时`topPadding`不起作用的[BUG#29](https://github.com/youngsoft/MyLinearLayout/issues/29)
1629
4. 修复了相对布局`MyRelativeLayout`中子视图的高度设置为`flexedHeight`时计算可能不正常的问题。
1730

1831
#### Changed

MyLayout.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "MyLayout"
19-
s.version = "1.3.0"
19+
s.version = "1.3.1"
2020
s.summary = "MyLayout is an iOS UI framework integrates the functions with Android,AutoLayout,SizeClass,HTML CSS float and flexbox,UIView UITableView."
2121

2222
s.description = <<-DESC
@@ -75,7 +75,7 @@ Pod::Spec.new do |s|
7575
# Supports git, hg, bzr, svn and HTTP.
7676
#
7777

78-
s.source = { :git => "https://github.com/youngsoft/MyLinearLayout.git", :tag => "1.3.0" }
78+
s.source = { :git => "https://github.com/youngsoft/MyLinearLayout.git", :tag => "1.3.1" }
7979

8080

8181
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

MyLayout.xcodeproj/project.pbxproj

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/* Begin PBXBuildFile section */
1010
18014BA51C9079DA0088133B /* MyDimeScale.m in Sources */ = {isa = PBXBuildFile; fileRef = 18014BA41C9079DA0088133B /* MyDimeScale.m */; };
11+
181068371E0B4EA9000B9B86 /* AllTest8ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 181068361E0B4EA9000B9B86 /* AllTest8ViewController.m */; };
1112
181ECE631D570CA1007803BE /* YYFPSLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 181ECE5F1D570CA1007803BE /* YYFPSLabel.m */; };
1213
181ECE641D570CA1007803BE /* YYWeakProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 181ECE601D570CA1007803BE /* YYWeakProxy.m */; };
1314
181F97F51E079462004A9AE6 /* RLTest5ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 181F97F41E079462004A9AE6 /* RLTest5ViewController.m */; };
@@ -100,6 +101,8 @@
100101
/* Begin PBXFileReference section */
101102
18014BA31C9079DA0088133B /* MyDimeScale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDimeScale.h; sourceTree = "<group>"; };
102103
18014BA41C9079DA0088133B /* MyDimeScale.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyDimeScale.m; sourceTree = "<group>"; };
104+
181068351E0B4EA9000B9B86 /* AllTest8ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllTest8ViewController.h; sourceTree = "<group>"; };
105+
181068361E0B4EA9000B9B86 /* AllTest8ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AllTest8ViewController.m; sourceTree = "<group>"; };
103106
181ECE5F1D570CA1007803BE /* YYFPSLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YYFPSLabel.m; sourceTree = "<group>"; };
104107
181ECE601D570CA1007803BE /* YYWeakProxy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YYWeakProxy.m; sourceTree = "<group>"; };
105108
181ECE611D570CA1007803BE /* YYWeakProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YYWeakProxy.h; sourceTree = "<group>"; };
@@ -496,6 +499,8 @@
496499
188261CE1C647CB300996C2C /* AllTest6ViewController.m */,
497500
183C14611DB9DD1A00C38448 /* AllTest7ViewController.h */,
498501
183C14621DB9DD1A00C38448 /* AllTest7ViewController.m */,
502+
181068351E0B4EA9000B9B86 /* AllTest8ViewController.h */,
503+
181068361E0B4EA9000B9B86 /* AllTest8ViewController.m */,
499504
);
500505
name = IntegratedDemo;
501506
sourceTree = "<group>";
@@ -735,6 +740,7 @@
735740
188261CF1C647CB300996C2C /* AllTest6ViewController.m in Sources */,
736741
18D684401C4F421400A48BB4 /* MyLayoutPos.m in Sources */,
737742
18D684321C4F421400A48BB4 /* AllTest3ViewController.m in Sources */,
743+
181068371E0B4EA9000B9B86 /* AllTest8ViewController.m in Sources */,
738744
18D6844F1C4F421400A48BB4 /* RLTest3ViewController.m in Sources */,
739745
189692701CF74E7E000A5B91 /* AllTest2TableViewCell.m in Sources */,
740746
18D6843D1C4F421400A48BB4 /* MyBaseLayout.m in Sources */,

MyLayout/AllTest3ViewController.m

+54-3
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,13 @@ -(void)loadView
101101
//添加,隐藏重新布局的布局。
102102
[self addHideSubviewReLayoutLayout:contentLayout];
103103

104-
105-
106104
//添加,自动伸缩布局
107105
[self addShrinkLayout:contentLayout];
108106

109107

108+
//测试布局位置和布局尺寸的active属性。
109+
[self addActiveLayout:contentLayout];
110+
110111

111112
}
112113

@@ -315,7 +316,6 @@ -(void)addShrinkLayout:(MyLinearLayout*)contentLayout
315316
testLayout.padding = UIEdgeInsetsMake(10, 10, 10, 10);
316317
testLayout.subviewHorzMargin = 10;
317318
testLayout.subviewVertMargin = 10;
318-
testLayout.myBottomMargin = 50; //这里设置底部间距的原因是登录按钮在最底部。为了使得滚动到底部时不被覆盖。
319319
testLayout.heightDime.equalTo(@50);
320320
testLayout.clipsToBounds = YES;
321321
[contentLayout addSubview:testLayout];
@@ -335,6 +335,33 @@ -(void)addShrinkLayout:(MyLinearLayout*)contentLayout
335335

336336
}
337337

338+
//这个例子用来描述布局位置和布局尺寸对象的active属性的使用。
339+
-(void)addActiveLayout:(MyLinearLayout*)contentLayout
340+
{
341+
/*
342+
这个例子提供了1.3.1版本中MyLayoutSize和MyLayoutPos类新加入的属性active属性的使用方法。默认情况下这个属性的值都是YES表示指定的位置或者尺寸的设置是有效的,如果设置为NO则这个位置或者这个尺寸的设置将无效,不会对布局产生影响。因此你可以通过为位置对象或者尺寸对象设置是否为active来在运行中进行界面布局的动态调整。
343+
*/
344+
MyLinearLayout *testLayout = [MyLinearLayout linearLayoutWithOrientation:MyLayoutViewOrientation_Vert];
345+
testLayout.padding = UIEdgeInsetsMake(10, 10, 10, 10);
346+
testLayout.backgroundColor = [UIColor whiteColor];
347+
testLayout.myTopMargin = 10;
348+
testLayout.myBottomMargin = 50; //这里设置底部间距的原因是登录按钮在最底部。为了使得滚动到底部时不被覆盖。你也可以设置contentLayout的bottomPadding = 50来解决这个问题。
349+
[contentLayout addSubview:testLayout];
350+
351+
UIButton *testButton = [UIButton buttonWithType:UIButtonTypeSystem];
352+
[testButton setTitle:@"Click me" forState:UIControlStateNormal];
353+
testButton.backgroundColor = [CFTool color:0];
354+
testButton.heightDime.equalTo(@50);
355+
testButton.widthDime.equalTo(testButton.widthDime).add(20);
356+
testButton.leftPos.equalTo(@10).active = YES; //左边边距是10,设置active为YES表示左边位置对象的设置是生效的。
357+
testButton.rightPos.equalTo(@10).active = NO; //右边边距是10,设置active为NO表示右边位置对象的设置是不生效的。
358+
359+
[testButton addTarget:self action:@selector(handleActiveTest:) forControlEvents:UIControlEventTouchUpInside];
360+
361+
[testLayout addSubview:testButton];
362+
363+
}
364+
338365
//创建可执动作事件的布局
339366
-(MyLinearLayout*)createActionLayout:(NSString*)title action:(SEL)action
340367
{
@@ -739,6 +766,30 @@ -(void)handleClosePopmenu:(UIButton*)sender
739766

740767
}
741768

769+
-(void)handleActiveTest:(UIButton*)sender
770+
{
771+
//下面代码中布局位置的active属性设置的变化所产生的效果。
772+
if (sender.leftPos.isActive && sender.rightPos.isActive)
773+
{
774+
sender.leftPos.active = YES;
775+
sender.rightPos.active = NO; //按钮将停靠在父布局的左边。
776+
}
777+
else if (sender.leftPos.isActive)
778+
{
779+
sender.leftPos.active = NO;
780+
sender.rightPos.active = YES; //按钮将停靠在父布局的右边
781+
}
782+
else if (sender.rightPos.isActive)
783+
{
784+
sender.leftPos.active = YES;
785+
sender.rightPos.active = YES; //按钮的左右边距都生效,并且会拉伸按钮的宽度。
786+
}
787+
788+
MyLinearLayout *superLayout = (MyLinearLayout*)sender.superview;
789+
[superLayout layoutAnimationWithDuration:0.3];
790+
791+
}
792+
742793
/*
743794
#pragma mark - Navigation
744795

MyLayout/AllTest8ViewController.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// AllTest8ViewController.h
3+
// MyLayout
4+
//
5+
// Created by apple on 16/12/22.
6+
// Copyright © 2016年 YoungSoft. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
/**
12+
* 布局视图放入非布局父视图
13+
*/
14+
@interface AllTest8ViewController : UIViewController
15+
16+
@end

0 commit comments

Comments
 (0)