Skip to content

Commit 5bc63a8

Browse files
author
欧柏泉
committed
修正了一个键盘弹出的问题,原因是因为定义的View的扩展的size属性,跟键盘对象的内部的size属性有冲突导致的,因此这里去掉了size这个扩展的属性。在此谢谢whtoo提供的问题,请大家及时更新库代码。
1 parent 4adce45 commit 5bc63a8

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

MyLinearLayoutDemo.xcodeproj/project.pbxproj

+7
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@
286286
TargetAttributes = {
287287
1840828C1B2C46E8003F378B = {
288288
CreatedOnToolsVersion = 6.3.2;
289+
DevelopmentTeam = 9JJMH944SE;
289290
};
290291
184082A51B2C46E8003F378B = {
291292
CreatedOnToolsVersion = 6.3.2;
@@ -479,10 +480,13 @@
479480
isa = XCBuildConfiguration;
480481
buildSettings = {
481482
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
483+
CODE_SIGN_IDENTITY = "iPhone Developer";
484+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
482485
INFOPLIST_FILE = MyLinearLayoutDemo/Info.plist;
483486
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
484487
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
485488
PRODUCT_NAME = "$(TARGET_NAME)";
489+
PROVISIONING_PROFILE = "";
486490
TARGETED_DEVICE_FAMILY = "1,2";
487491
};
488492
name = Debug;
@@ -491,10 +495,13 @@
491495
isa = XCBuildConfiguration;
492496
buildSettings = {
493497
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
498+
CODE_SIGN_IDENTITY = "iPhone Developer";
499+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
494500
INFOPLIST_FILE = MyLinearLayoutDemo/Info.plist;
495501
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
496502
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
497503
PRODUCT_NAME = "$(TARGET_NAME)";
504+
PROVISIONING_PROFILE = "";
498505
TARGETED_DEVICE_FAMILY = "1,2";
499506
};
500507
name = Release;

MyLinearLayoutDemo/MyLayoutBase.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ typedef enum : unsigned char {
128128

129129

130130
/*
131-
下面三个属性是上面widthDime,heightDime的equalTo设置NSNumber类型值的简化版本,主要用在线性布局和框架布局里面
131+
下面两个属性是上面widthDime,heightDime的equalTo设置NSNumber类型值的简化版本,主要用在线性布局和框架布局里面
132132
表示设置视图的宽度和高度,需要注意的是设置这三个值并不是直接设置frame里面的size的宽度和高度,而是设置的布局的高度和宽度值。
133133
也就是说设置和获取值并不一定是最终视图在布局时的真实高度和宽度,这三个属性的值最好别用于读取,而只是单纯用于设置
134134
@@ -137,7 +137,6 @@ typedef enum : unsigned char {
137137
*/
138138
@property(nonatomic,assign) CGFloat width;
139139
@property(nonatomic,assign) CGFloat height;
140-
@property(nonatomic,assign) CGSize size;
141140

142141
@end
143142

MyLinearLayoutDemo/MyLayoutBase.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ -(void)setHeight:(CGFloat)height
208208
self.heightDime.equalTo(@(height));
209209
}
210210

211+
/*
211212
-(CGSize)size
212213
{
213214
return CGSizeMake(self.width, self.height);
@@ -219,7 +220,7 @@ -(void)setSize:(CGSize)size
219220
self.height = size.height;
220221
}
221222
222-
223+
*/
223224
-(MyLayoutPos*)centerXPos
224225
{
225226
MyLayoutPos *pos = objc_getAssociatedObject(self, ASSOCIATEDOBJECT_KEY_RELATIVE_CENTERX);

MyLinearLayoutDemo/Test1ViewController.m

+6-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ -(UIView*)createView:(BOOL)wrapContentHeight
3131

3232
v1.topMargin = 4;
3333
v1.leftMargin = 10;
34-
v1.size = CGSizeMake(60, 40);
34+
v1.width = 60;
35+
v1.height = 40;
3536

3637
/* [v1 makeLayout:^(MyMaker *make) {
3738
@@ -49,7 +50,8 @@ -(UIView*)createView:(BOOL)wrapContentHeight
4950

5051
v2.topMargin = 6;
5152
v2.leftMargin = 20;
52-
v2.size = CGSizeMake(40, 60);
53+
v2.width = 40;
54+
v2.height = 60;
5355

5456

5557
//您也可以不设置width,height而是直接设置frame的宽度和高度
@@ -77,7 +79,8 @@ -(void)loadView
7779
//标尺视图
7880
UIView *v = [UIView new];
7981
v.backgroundColor = [UIColor blackColor];
80-
v.size = CGSizeMake(10, 200);
82+
v.width = 10;
83+
v.height = 200;
8184
[test1ll addSubview:v];
8285

8386
[test1ll addSubview:[self createView:NO]];

0 commit comments

Comments
 (0)