@aks-dev/easyui 1.0.31 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/easyui/UpgradeModule.java +2 -2
- package/ios/UpgradeModule.m +80 -1
- package/ios/assets/infor_colse_image.png +0 -0
- package/ios/assets/upgrade_bg.png +0 -0
- package/ios/libs/LEEAlert/LEEAlert.h +462 -0
- package/ios/libs/LEEAlert/LEEAlert.m +3823 -0
- package/ios/libs/LEEAlert/LEEAlertHelper.h +153 -0
- package/ios/libs/SDAutoLayout/SDAutoLayout.h +24 -0
- package/ios/libs/SDAutoLayout/UITableView+SDAutoTableViewCellHeight.h +169 -0
- package/ios/libs/SDAutoLayout/UITableView+SDAutoTableViewCellHeight.m +537 -0
- package/ios/libs/SDAutoLayout/UIView+SDAutoLayout.h +484 -0
- package/ios/libs/SDAutoLayout/UIView+SDAutoLayout.m +1812 -0
- package/ios/views/UpgradeView.h +23 -0
- package/ios/views/UpgradeView.m +172 -0
- package/jsbridge/index.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
//
|
|
2
|
+
// UIView+SDAutoLayout.h
|
|
3
|
+
//
|
|
4
|
+
// Created by gsd on 15/10/6.
|
|
5
|
+
// Copyright (c) 2015年 gsd. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
*************************************************************************
|
|
10
|
+
|
|
11
|
+
--------- INTRODUCTION ---------
|
|
12
|
+
|
|
13
|
+
USAGE:
|
|
14
|
+
|
|
15
|
+
MODE 1. >>>>>>>>>>>>>>> You can use it in this way:
|
|
16
|
+
|
|
17
|
+
Demo.sd_layout
|
|
18
|
+
.topSpaceToView(v1, 100)
|
|
19
|
+
.bottomSpaceToView(v3, 100)
|
|
20
|
+
.leftSpaceToView(v0, 150)
|
|
21
|
+
.rightSpaceToView(v2, 150);
|
|
22
|
+
|
|
23
|
+
MODE 2. >>>>>>>>>>>>>>> You can also use it in this way that is more brevity:
|
|
24
|
+
|
|
25
|
+
Demo.sd_layout.topSpaceToView(v1, 100).bottomSpaceToView(v3, 100).leftSpaceToView(v0, 150).rightSpaceToView(v2, 150);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
*************************************************************************
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
|
|
34
|
+
*********************************************************************************
|
|
35
|
+
*
|
|
36
|
+
* 在您使用此自动布局库的过程中如果出现bug请及时以以下任意一种方式联系我们,我们会及时修复bug并
|
|
37
|
+
* 帮您解决问题。
|
|
38
|
+
* QQ : 2689718696(gsdios)
|
|
39
|
+
* Email : gsdios@126.com
|
|
40
|
+
* GitHub: https://github.com/gsdios
|
|
41
|
+
* 新浪微博:GSD_iOS
|
|
42
|
+
*
|
|
43
|
+
* 视频教程:http://www.letv.com/ptv/vplay/24038772.html
|
|
44
|
+
* 用法示例:https://github.com/gsdios/SDAutoLayout/blob/master/README.md
|
|
45
|
+
*
|
|
46
|
+
*********************************************************************************
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
SDAutoLayout
|
|
50
|
+
版本:2.1.7
|
|
51
|
+
发布:2016.08.12
|
|
52
|
+
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
// 如果需要用“断言”调试程序请打开此宏
|
|
57
|
+
|
|
58
|
+
//#define SDDebugWithAssert
|
|
59
|
+
|
|
60
|
+
#import <UIKit/UIKit.h>
|
|
61
|
+
|
|
62
|
+
@class SDAutoLayoutModel, SDUIViewCategoryManager;
|
|
63
|
+
|
|
64
|
+
typedef SDAutoLayoutModel *(^MarginToView)(id viewOrViewsArray, CGFloat value);
|
|
65
|
+
typedef SDAutoLayoutModel *(^Margin)(CGFloat value);
|
|
66
|
+
typedef SDAutoLayoutModel *(^MarginEqualToView)(UIView *toView);
|
|
67
|
+
typedef SDAutoLayoutModel *(^WidthHeight)(CGFloat value);
|
|
68
|
+
typedef SDAutoLayoutModel *(^WidthHeightEqualToView)(UIView *toView, CGFloat ratioValue);
|
|
69
|
+
typedef SDAutoLayoutModel *(^AutoHeightWidth)(CGFloat ratioValue);
|
|
70
|
+
typedef SDAutoLayoutModel *(^SameWidthHeight)(void);
|
|
71
|
+
typedef SDAutoLayoutModel *(^Offset)(CGFloat value);
|
|
72
|
+
typedef void (^SpaceToSuperView)(UIEdgeInsets insets);
|
|
73
|
+
|
|
74
|
+
@interface SDAutoLayoutModel : NSObject
|
|
75
|
+
|
|
76
|
+
/*
|
|
77
|
+
*************************说明************************
|
|
78
|
+
|
|
79
|
+
方法名中带有“SpaceToView”的需要传递2个参数:(UIView)参照view 和 (CGFloat)间距数值
|
|
80
|
+
方法名中带有“RatioToView”的需要传递2个参数:(UIView)参照view 和 (CGFloat)倍数
|
|
81
|
+
方法名中带有“EqualToView”的需要传递1个参数:(UIView)参照view
|
|
82
|
+
方法名中带有“Is”的需要传递1个参数:(CGFloat)数值
|
|
83
|
+
|
|
84
|
+
*****************************************************
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
/* 设置距离其它view的间距 */
|
|
89
|
+
|
|
90
|
+
/** 左边到其参照view之间的间距,参数为“(View 或者 view数组, CGFloat)” */
|
|
91
|
+
@property (nonatomic, copy, readonly) MarginToView leftSpaceToView;
|
|
92
|
+
/** 右边到其参照view之间的间距,参数为“(View, CGFloat)” */
|
|
93
|
+
@property (nonatomic, copy, readonly) MarginToView rightSpaceToView;
|
|
94
|
+
/** 顶部到其参照view之间的间距,参数为“(View 或者 view数组, CGFloat)” */
|
|
95
|
+
@property (nonatomic, copy, readonly) MarginToView topSpaceToView;
|
|
96
|
+
/** 底部到其参照view之间的间距,参数为“(View, CGFloat)” */
|
|
97
|
+
@property (nonatomic, copy, readonly) MarginToView bottomSpaceToView;
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
/* 设置x、y、width、height、centerX、centerY 值 */
|
|
102
|
+
|
|
103
|
+
/** x值,参数为“(CGFloat)” */
|
|
104
|
+
@property (nonatomic, copy, readonly) Margin xIs;
|
|
105
|
+
/** y值,参数为“(CGFloat)” */
|
|
106
|
+
@property (nonatomic, copy, readonly) Margin yIs;
|
|
107
|
+
/** centerX值,参数为“(CGFloat)” */
|
|
108
|
+
@property (nonatomic, copy, readonly) Margin centerXIs;
|
|
109
|
+
/** centerY值,参数为“(CGFloat)” */
|
|
110
|
+
@property (nonatomic, copy, readonly) Margin centerYIs;
|
|
111
|
+
/** 宽度值,参数为“(CGFloat)” */
|
|
112
|
+
@property (nonatomic, copy, readonly) WidthHeight widthIs;
|
|
113
|
+
/** 高度值,参数为“(CGFloat)” */
|
|
114
|
+
@property (nonatomic, copy, readonly) WidthHeight heightIs;
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
/* 设置最大宽度和高度、最小宽度和高度 */
|
|
119
|
+
|
|
120
|
+
/** 最大宽度值,参数为“(CGFloat)” */
|
|
121
|
+
@property (nonatomic, copy, readonly) WidthHeight maxWidthIs;
|
|
122
|
+
/** 最大高度值,参数为“(CGFloat)” */
|
|
123
|
+
@property (nonatomic, copy, readonly) WidthHeight maxHeightIs;
|
|
124
|
+
/** 最小宽度值,参数为“(CGFloat)” */
|
|
125
|
+
@property (nonatomic, copy, readonly) WidthHeight minWidthIs;
|
|
126
|
+
/** 最小高度值,参数为“(CGFloat)” */
|
|
127
|
+
@property (nonatomic, copy, readonly) WidthHeight minHeightIs;
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
/* 设置和某个参照view的边距相同 */
|
|
132
|
+
|
|
133
|
+
/** 左间距与参照view相同,参数为“(View)” */
|
|
134
|
+
@property (nonatomic, copy, readonly) MarginEqualToView leftEqualToView;
|
|
135
|
+
/** 右间距与参照view相同,参数为“(View)” */
|
|
136
|
+
@property (nonatomic, copy, readonly) MarginEqualToView rightEqualToView;
|
|
137
|
+
/** 顶部间距与参照view相同,参数为“(View)” */
|
|
138
|
+
@property (nonatomic, copy, readonly) MarginEqualToView topEqualToView;
|
|
139
|
+
/** 底部间距与参照view相同,参数为“(View)” */
|
|
140
|
+
@property (nonatomic, copy, readonly) MarginEqualToView bottomEqualToView;
|
|
141
|
+
/** centerX与参照view相同,参数为“(View)” */
|
|
142
|
+
@property (nonatomic, copy, readonly) MarginEqualToView centerXEqualToView;
|
|
143
|
+
/** centerY与参照view相同,参数为“(View)” */
|
|
144
|
+
@property (nonatomic, copy, readonly) MarginEqualToView centerYEqualToView;
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
/* 设置宽度或者高度等于参照view的多少倍 */
|
|
149
|
+
|
|
150
|
+
/** 宽度是参照view宽度的多少倍,参数为“(View, CGFloat)” */
|
|
151
|
+
@property (nonatomic, copy, readonly) WidthHeightEqualToView widthRatioToView;
|
|
152
|
+
/** 高度是参照view高度的多少倍,参数为“(View, CGFloat)” */
|
|
153
|
+
@property (nonatomic, copy, readonly) WidthHeightEqualToView heightRatioToView;
|
|
154
|
+
/** 设置一个view的宽度和它的高度相同,参数为空“()” */
|
|
155
|
+
@property (nonatomic, copy, readonly) SameWidthHeight widthEqualToHeight;
|
|
156
|
+
/** 设置一个view的高度和它的宽度相同,参数为空“()” */
|
|
157
|
+
@property (nonatomic, copy, readonly) SameWidthHeight heightEqualToWidth;
|
|
158
|
+
/** 自适应高度,传入高宽比值,label可以传0实现文字高度自适应 */
|
|
159
|
+
@property (nonatomic, copy, readonly) AutoHeightWidth autoHeightRatio;
|
|
160
|
+
|
|
161
|
+
/** 自适应宽度,参数为宽高比值 */
|
|
162
|
+
@property (nonatomic, copy, readonly) AutoHeightWidth autoWidthRatio;
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
/* 填充父view(快捷方法) */
|
|
167
|
+
|
|
168
|
+
/** 传入UIEdgeInsetsMake(top, left, bottom, right),可以快捷设置view到其父view上左下右的间距 */
|
|
169
|
+
@property (nonatomic, copy, readonly) SpaceToSuperView spaceToSuperView;
|
|
170
|
+
|
|
171
|
+
/** 设置偏移量,参数为“(CGFloat value),目前只有带有equalToView的方法可以设置offset” */
|
|
172
|
+
@property (nonatomic, copy, readonly) Offset offset;
|
|
173
|
+
|
|
174
|
+
@property (nonatomic, weak) UIView *needsAutoResizeView;
|
|
175
|
+
|
|
176
|
+
@end
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
#pragma mark - UIView 高度、宽度自适应相关方法
|
|
181
|
+
|
|
182
|
+
@interface UIView (SDAutoHeightWidth)
|
|
183
|
+
|
|
184
|
+
/** 设置Cell的高度自适应,也可用于设置普通view内容高度自适应 */
|
|
185
|
+
- (void)setupAutoHeightWithBottomView:(UIView *)bottomView bottomMargin:(CGFloat)bottomMargin;
|
|
186
|
+
|
|
187
|
+
/** 用于设置普通view内容宽度自适应 */
|
|
188
|
+
- (void)setupAutoWidthWithRightView:(UIView *)rightView rightMargin:(CGFloat)rightMargin;
|
|
189
|
+
|
|
190
|
+
/** 设置Cell的高度自适应,也可用于设置普通view内容自适应(应用于当你不确定哪个view在自动布局之后会排布在最下方最为bottomView的时候可以调用次方法将所有可能在最下方的view都传过去) */
|
|
191
|
+
- (void)setupAutoHeightWithBottomViewsArray:(NSArray *)bottomViewsArray bottomMargin:(CGFloat)bottomMargin;
|
|
192
|
+
|
|
193
|
+
/** 更新布局(主动刷新布局,如果你需要设置完布局代码就获得view的frame请调用此方法) */
|
|
194
|
+
- (void)updateLayout;
|
|
195
|
+
|
|
196
|
+
/** 更新cell内部的控件的布局(cell内部控件专属的更新约束方法,如果启用了cell frame缓存则会自动清除缓存再更新约束) */
|
|
197
|
+
- (void)updateLayoutWithCellContentView:(UIView *)cellContentView;
|
|
198
|
+
|
|
199
|
+
/** 清空高度自适应设置 */
|
|
200
|
+
- (void)clearAutoHeigtSettings;
|
|
201
|
+
|
|
202
|
+
/** 清空宽度自适应设置 */
|
|
203
|
+
- (void)clearAutoWidthSettings;
|
|
204
|
+
|
|
205
|
+
@property (nonatomic) CGFloat autoHeight;
|
|
206
|
+
|
|
207
|
+
@property (nonatomic, readonly) SDUIViewCategoryManager *sd_categoryManager;
|
|
208
|
+
|
|
209
|
+
@property (nonatomic, readonly) NSMutableArray *sd_bottomViewsArray;
|
|
210
|
+
@property (nonatomic) CGFloat sd_bottomViewBottomMargin;
|
|
211
|
+
|
|
212
|
+
@property (nonatomic) NSArray *sd_rightViewsArray;
|
|
213
|
+
@property (nonatomic) CGFloat sd_rightViewRightMargin;
|
|
214
|
+
|
|
215
|
+
@end
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
#pragma mark - UIView 设置圆角半径、自动布局回调block等相关方法
|
|
220
|
+
|
|
221
|
+
@interface UIView (SDLayoutExtention)
|
|
222
|
+
|
|
223
|
+
/** 自动布局完成后的回调block,可以在这里获取到view的真实frame */
|
|
224
|
+
@property (nonatomic) void (^didFinishAutoLayoutBlock)(CGRect frame);
|
|
225
|
+
|
|
226
|
+
/** 添加一组子view */
|
|
227
|
+
- (void)sd_addSubviews:(NSArray *)subviews;
|
|
228
|
+
|
|
229
|
+
/* 设置圆角 */
|
|
230
|
+
|
|
231
|
+
/** 设置圆角半径值 */
|
|
232
|
+
@property (nonatomic, strong) NSNumber *sd_cornerRadius;
|
|
233
|
+
/** 设置圆角半径值为view宽度的多少倍 */
|
|
234
|
+
@property (nonatomic, strong) NSNumber *sd_cornerRadiusFromWidthRatio;
|
|
235
|
+
/** 设置圆角半径值为view高度的多少倍 */
|
|
236
|
+
@property (nonatomic, strong) NSNumber *sd_cornerRadiusFromHeightRatio;
|
|
237
|
+
|
|
238
|
+
/** 设置等宽子view(子view需要在同一水平方向) */
|
|
239
|
+
@property (nonatomic, strong) NSArray *sd_equalWidthSubviews;
|
|
240
|
+
|
|
241
|
+
@end
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
#pragma mark - UIView 九宫格浮动布局效果
|
|
246
|
+
|
|
247
|
+
@interface UIView (SDAutoFlowItems)
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* 设置类似collectionView效果的固定间距自动宽度浮动子view
|
|
251
|
+
* viewsArray : 需要浮动布局的所有视图
|
|
252
|
+
* perRowItemsCount : 每行显示的视图个数
|
|
253
|
+
* verticalMargin : 视图之间的垂直间距
|
|
254
|
+
* horizontalMargin : 视图之间的水平间距
|
|
255
|
+
* vInset : 上下缩进值
|
|
256
|
+
* hInset : 左右缩进值
|
|
257
|
+
*/
|
|
258
|
+
- (void)setupAutoWidthFlowItems:(NSArray *)viewsArray withPerRowItemsCount:(NSInteger)perRowItemsCount verticalMargin:(CGFloat)verticalMargin horizontalMargin:(CGFloat)horizontalMagin verticalEdgeInset:(CGFloat)vInset horizontalEdgeInset:(CGFloat)hInset;
|
|
259
|
+
|
|
260
|
+
/** 清除固定间距自动宽度浮动子view设置 */
|
|
261
|
+
- (void)clearAutoWidthFlowItemsSettings;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* 设置类似collectionView效果的固定宽带自动间距浮动子view
|
|
265
|
+
* viewsArray : 需要浮动布局的所有视图
|
|
266
|
+
* perRowItemsCount : 每行显示的视图个数
|
|
267
|
+
* verticalMargin : 视图之间的垂直间距
|
|
268
|
+
* vInset : 上下缩进值
|
|
269
|
+
* hInset : 左右缩进值
|
|
270
|
+
*/
|
|
271
|
+
- (void)setupAutoMarginFlowItems:(NSArray *)viewsArray withPerRowItemsCount:(NSInteger)perRowItemsCount itemWidth:(CGFloat)itemWidth verticalMargin:(CGFloat)verticalMargin verticalEdgeInset:(CGFloat)vInset horizontalEdgeInset:(CGFloat)hInset;
|
|
272
|
+
|
|
273
|
+
/** 清除固定宽带自动间距浮动子view设置 */
|
|
274
|
+
- (void)clearAutoMarginFlowItemsSettings;
|
|
275
|
+
|
|
276
|
+
@end
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
#pragma mark - UIView 设置约束、更新约束、清空约束、从父view移除并清空约束、开启cell的frame缓存等相关方法
|
|
281
|
+
|
|
282
|
+
@interface UIView (SDAutoLayout)
|
|
283
|
+
|
|
284
|
+
/** 开始自动布局 */
|
|
285
|
+
- (SDAutoLayoutModel *)sd_layout;
|
|
286
|
+
|
|
287
|
+
/** 清空之前的自动布局设置,重新开始自动布局(重新生成布局约束并使其在父view的布局序列数组中位置保持不变) */
|
|
288
|
+
- (SDAutoLayoutModel *)sd_resetLayout;
|
|
289
|
+
|
|
290
|
+
/** 清空之前的自动布局设置,重新开始自动布局(重新生成布局约束并添加到父view布局序列数组中的最后一个位置) */
|
|
291
|
+
- (SDAutoLayoutModel *)sd_resetNewLayout;
|
|
292
|
+
|
|
293
|
+
/** 是否关闭自动布局 */
|
|
294
|
+
@property (nonatomic, getter = sd_isClosingAutoLayout) BOOL sd_closeAutoLayout;
|
|
295
|
+
|
|
296
|
+
/** 从父view移除并清空约束 */
|
|
297
|
+
- (void)removeFromSuperviewAndClearAutoLayoutSettings;
|
|
298
|
+
|
|
299
|
+
/** 清空之前的自动布局设置 */
|
|
300
|
+
- (void)sd_clearAutoLayoutSettings;
|
|
301
|
+
|
|
302
|
+
/** 将自身frame清零(一般在cell内部控件重用前调用) */
|
|
303
|
+
- (void)sd_clearViewFrameCache;
|
|
304
|
+
|
|
305
|
+
/** 将自己的需要自动布局的subviews的frame(或者frame缓存)清零 */
|
|
306
|
+
- (void)sd_clearSubviewsAutoLayoutFrameCaches;
|
|
307
|
+
|
|
308
|
+
/** 设置固定宽度保证宽度不在自动布局过程再做中调整 */
|
|
309
|
+
@property (nonatomic, strong) NSNumber *fixedWidth;
|
|
310
|
+
|
|
311
|
+
/** 设置固定高度保证高度不在自动布局过程中再做调整 */
|
|
312
|
+
@property (nonatomic, strong) NSNumber *fixedHeight;
|
|
313
|
+
|
|
314
|
+
/** 启用cell frame缓存(可以提高cell滚动的流畅度, 目前为cell专用方法,后期会扩展到其他view) */
|
|
315
|
+
- (void)useCellFrameCacheWithIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableview;
|
|
316
|
+
|
|
317
|
+
/** 所属tableview(目前为cell专用属性,后期会扩展到其他view) */
|
|
318
|
+
@property (nonatomic) UITableView *sd_tableView;
|
|
319
|
+
|
|
320
|
+
/** cell的indexPath(目前为cell专用属性,后期会扩展到cell的其他子view) */
|
|
321
|
+
@property (nonatomic) NSIndexPath *sd_indexPath;
|
|
322
|
+
|
|
323
|
+
- (NSMutableArray *)autoLayoutModelsArray;
|
|
324
|
+
- (void)addAutoLayoutModel:(SDAutoLayoutModel *)model;
|
|
325
|
+
@property (nonatomic) SDAutoLayoutModel *ownLayoutModel;
|
|
326
|
+
@property (nonatomic, strong) NSNumber *sd_maxWidth;
|
|
327
|
+
@property (nonatomic, strong) NSNumber *autoHeightRatioValue;
|
|
328
|
+
@property (nonatomic, strong) NSNumber *autoWidthRatioValue;
|
|
329
|
+
|
|
330
|
+
@end
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
#pragma mark - UIScrollView 内容竖向自适应、内容横向自适应方法
|
|
335
|
+
|
|
336
|
+
@interface UIScrollView (SDAutoContentSize)
|
|
337
|
+
|
|
338
|
+
/** 设置scrollview内容竖向自适应 */
|
|
339
|
+
- (void)setupAutoContentSizeWithBottomView:(UIView *)bottomView bottomMargin:(CGFloat)bottomMargin;
|
|
340
|
+
|
|
341
|
+
/** 设置scrollview内容横向自适应 */
|
|
342
|
+
- (void)setupAutoContentSizeWithRightView:(UIView *)rightView rightMargin:(CGFloat)rightMargin;
|
|
343
|
+
|
|
344
|
+
@end
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
#pragma mark - UILabel 开启富文本布局、设置单行文本label宽度自适应、 设置label最多可以显示的行数
|
|
349
|
+
|
|
350
|
+
@interface UILabel (SDLabelAutoResize)
|
|
351
|
+
|
|
352
|
+
/** 是否是attributedString */
|
|
353
|
+
@property (nonatomic) BOOL isAttributedContent;
|
|
354
|
+
|
|
355
|
+
/** 设置单行文本label宽度自适应 */
|
|
356
|
+
- (void)setSingleLineAutoResizeWithMaxWidth:(CGFloat)maxWidth;
|
|
357
|
+
|
|
358
|
+
/** 设置label最多可以显示多少行,如果传0则显示所有行文字 */
|
|
359
|
+
- (void)setMaxNumberOfLinesToShow:(NSInteger)lineCount;
|
|
360
|
+
|
|
361
|
+
@end
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
#pragma mark - UIButton 设置button根据单行文字自适应
|
|
366
|
+
|
|
367
|
+
@interface UIButton (SDExtention)
|
|
368
|
+
|
|
369
|
+
/*
|
|
370
|
+
* 设置button根据单行文字自适应
|
|
371
|
+
* hPadding:左右边距
|
|
372
|
+
*/
|
|
373
|
+
- (void)setupAutoSizeWithHorizontalPadding:(CGFloat)hPadding buttonHeight:(CGFloat)buttonHeight;
|
|
374
|
+
|
|
375
|
+
@end
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
#pragma mark - 其他方法(如果有需要可以自己利用以下接口拓展更多功能)
|
|
405
|
+
|
|
406
|
+
@interface SDAutoLayoutModelItem : NSObject
|
|
407
|
+
|
|
408
|
+
@property (nonatomic, strong) NSNumber *value;
|
|
409
|
+
@property (nonatomic, weak) UIView *refView;
|
|
410
|
+
@property (nonatomic, assign) CGFloat offset;
|
|
411
|
+
@property (nonatomic, strong) NSArray *refViewsArray;
|
|
412
|
+
|
|
413
|
+
@end
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
@interface UIView (SDChangeFrame)
|
|
417
|
+
|
|
418
|
+
@property (nonatomic) BOOL shouldReadjustFrameBeforeStoreCache;
|
|
419
|
+
|
|
420
|
+
@property (nonatomic) CGFloat left_sd;
|
|
421
|
+
@property (nonatomic) CGFloat top_sd;
|
|
422
|
+
@property (nonatomic) CGFloat right_sd;
|
|
423
|
+
@property (nonatomic) CGFloat bottom_sd;
|
|
424
|
+
@property (nonatomic) CGFloat centerX_sd;
|
|
425
|
+
@property (nonatomic) CGFloat centerY_sd;
|
|
426
|
+
|
|
427
|
+
@property (nonatomic) CGFloat width_sd;
|
|
428
|
+
@property (nonatomic) CGFloat height_sd;
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
@property (nonatomic) CGPoint origin_sd;
|
|
432
|
+
@property (nonatomic) CGSize size_sd;
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
// 兼容旧版本
|
|
436
|
+
@property (nonatomic) CGFloat left;
|
|
437
|
+
@property (nonatomic) CGFloat top;
|
|
438
|
+
@property (nonatomic) CGFloat right;
|
|
439
|
+
@property (nonatomic) CGFloat bottom;
|
|
440
|
+
@property (nonatomic) CGFloat centerX;
|
|
441
|
+
@property (nonatomic) CGFloat centerY;
|
|
442
|
+
@property (nonatomic) CGFloat width;
|
|
443
|
+
@property (nonatomic) CGFloat height;
|
|
444
|
+
@property (nonatomic) CGPoint origin;
|
|
445
|
+
@property (nonatomic) CGSize size;
|
|
446
|
+
|
|
447
|
+
@end
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
@interface SDUIViewCategoryManager : NSObject
|
|
451
|
+
|
|
452
|
+
@property (nonatomic, strong) NSArray *rightViewsArray;
|
|
453
|
+
@property (nonatomic, assign) CGFloat rightViewRightMargin;
|
|
454
|
+
|
|
455
|
+
@property (nonatomic, weak) UITableView *sd_tableView;
|
|
456
|
+
@property (nonatomic, strong) NSIndexPath *sd_indexPath;
|
|
457
|
+
|
|
458
|
+
@property (nonatomic, assign) BOOL hasSetFrameWithCache;
|
|
459
|
+
|
|
460
|
+
@property (nonatomic) BOOL shouldReadjustFrameBeforeStoreCache;
|
|
461
|
+
|
|
462
|
+
@property (nonatomic, assign, getter = sd_isClosingAutoLayout) BOOL sd_closeAutoLayout;
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
/** 设置类似collectionView效果的固定间距自动宽度浮动子view */
|
|
466
|
+
|
|
467
|
+
@property (nonatomic, strong) NSArray *flowItems;
|
|
468
|
+
@property (nonatomic, assign) CGFloat verticalMargin;
|
|
469
|
+
@property (nonatomic, assign) CGFloat horizontalMargin;
|
|
470
|
+
@property (nonatomic, assign) NSInteger perRowItemsCount;
|
|
471
|
+
@property (nonatomic, assign) CGFloat lastWidth;
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
/** 设置类似collectionView效果的固定宽带自动间距浮动子view */
|
|
475
|
+
|
|
476
|
+
@property (nonatomic, assign) CGFloat flowItemWidth;
|
|
477
|
+
@property (nonatomic, assign) BOOL shouldShowAsAutoMarginViews;
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
@property (nonatomic) CGFloat horizontalEdgeInset;
|
|
481
|
+
@property (nonatomic) CGFloat verticalEdgeInset;
|
|
482
|
+
|
|
483
|
+
@end
|
|
484
|
+
|