Skip to content
Navigation Menu
{{ message }}
forked from youngsoft/MyLinearLayout
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFOLTest2ViewController.m
More file actions
765 lines (584 loc) · 25.4 KB
/
Copy pathFOLTest2ViewController.m
File metadata and controls
765 lines (584 loc) · 25.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
//
// FOLTest2ViewController.m
// MyLayout
//
// Created by oybq on 16/2/19.
// Copyright © 2016年 YoungSoft. All rights reserved.
//
#import "MyLayout.h"
#import "FOLTest2ViewController.h"
//数据模型。
@interface TBDataModel : NSObject
@property(nonatomic, strong) NSString *title; //标题
@property(nonatomic, strong) NSString *subTitle; //副标题
@property(nonatomic, strong) NSString *desc; //描述
@property(nonatomic, strong) NSString *price; //价格
@property(nonatomic, strong) NSString *image; //图片。
@property(nonatomic, strong) NSString *subImage; //子图片。
@end
@implementation TBDataModel
@end
@interface FOLTest2ViewController ()
@property(nonatomic, strong) MyLinearLayout *rootLayout;
@end
@implementation FOLTest2ViewController
//各种不同风格的条目布局
#pragma mark -- 各种风格的条目布局。
//品牌特卖主条目布局
-(MyFloatLayout*)createItemLayout1_1:(TBDataModel*)dataModel
{
MyFloatLayout *itemLayout = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Horz];
UILabel *titleLabel = [UILabel new];
titleLabel.text = dataModel.title;
titleLabel.font = [UIFont boldSystemFontOfSize:15];
titleLabel.myLeftMargin = 5;
titleLabel.myTopMargin = 5;
[titleLabel sizeToFit];
[itemLayout addSubview:titleLabel];
UIImageView *subImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:dataModel.subImage]];
subImageView.myLeftMargin = 5;
subImageView.myTopMargin = 5;
subImageView.myHeight = 20;
[subImageView sizeToFit];
[itemLayout addSubview:subImageView];
//占用剩余的高度,宽度和父布局相等。
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:dataModel.image]];
imageView.weight = 1;
imageView.widthDime.equalTo(itemLayout.widthDime);
[itemLayout addSubview:imageView];
return itemLayout;
}
//天猫超市条目布局
-(MyFloatLayout*)createItemLayout1_2:(TBDataModel*)dataModel
{
MyFloatLayout *itemLayout = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Vert];
UILabel *titleLabel = [UILabel new];
titleLabel.text = dataModel.title;
titleLabel.font = [UIFont boldSystemFontOfSize:15];
titleLabel.widthDime.equalTo(itemLayout.widthDime);
titleLabel.myLeftMargin = 5;
titleLabel.myTopMargin = 5;
[titleLabel sizeToFit];
[itemLayout addSubview:titleLabel];
UILabel *subTitleLabel = [UILabel new];
subTitleLabel.text = dataModel.subTitle;
subTitleLabel.font = [UIFont systemFontOfSize:12];
subTitleLabel.textColor = [UIColor lightGrayColor];
subTitleLabel.widthDime.equalTo(itemLayout.widthDime);
subTitleLabel.myLeftMargin = 5;
[subTitleLabel sizeToFit];
[itemLayout addSubview:subTitleLabel];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:dataModel.image]];
imageView.reverseFloat = YES;
imageView.myRightMargin = 5;
[imageView sizeToFit];
[itemLayout addSubview:imageView];
return itemLayout;
}
-(MyFloatLayout*)createItemLayout1_3:(TBDataModel*)dataModel
{
MyFloatLayout *itemLayout = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Vert];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:dataModel.image]];
imageView.heightDime.equalTo(itemLayout.heightDime);
imageView.reverseFloat = YES;
[imageView sizeToFit];
[itemLayout addSubview:imageView];
UILabel *titleLabel = [UILabel new];
titleLabel.text = dataModel.title;
titleLabel.font = [UIFont boldSystemFontOfSize:15];
titleLabel.myLeftMargin = 5;
titleLabel.myTopMargin = 5;
titleLabel.weight = 1;
[titleLabel sizeToFit];
[itemLayout addSubview:titleLabel];
UILabel *subTitleLabel = [UILabel new];
subTitleLabel.text = dataModel.subTitle;
subTitleLabel.font = [UIFont systemFontOfSize:12];
subTitleLabel.textColor = [UIColor lightGrayColor];
subTitleLabel.myLeftMargin = 5;
subTitleLabel.clearFloat = YES;
subTitleLabel.weight = 1;
subTitleLabel.numberOfLines = 0;
subTitleLabel.flexedHeight = YES;
[subTitleLabel sizeToFit];
[itemLayout addSubview:subTitleLabel];
if (dataModel.subImage != nil)
{
UIImageView *subImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:dataModel.subImage]];
subImageView.clearFloat = YES;
subImageView.myLeftMargin = 5;
[subImageView sizeToFit];
[itemLayout addSubview:subImageView];
}
return itemLayout;
}
-(MyFloatLayout*)createItemLayout2_1:(TBDataModel*)dataModel
{
MyFloatLayout *itemLayout = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Vert];
itemLayout.backgroundImage = [UIImage imageNamed:dataModel.image];
return itemLayout;
}
//精选市场
-(MyFloatLayout*)createItemLayout3_1:(TBDataModel*)dataModel
{
MyFloatLayout *itemLayout = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Horz];
UILabel *titleLabel = [UILabel new];
titleLabel.text = dataModel.title;
titleLabel.font = [UIFont boldSystemFontOfSize:15];
titleLabel.myLeftMargin = 5;
titleLabel.myTopMargin = 5;
[titleLabel sizeToFit];
[itemLayout addSubview:titleLabel];
UILabel *subTitleLabel = [UILabel new];
subTitleLabel.text = dataModel.subTitle;
subTitleLabel.font = [UIFont systemFontOfSize:11];
subTitleLabel.myLeftMargin = 5;
subTitleLabel.myTopMargin = 5;
[subTitleLabel sizeToFit];
[itemLayout addSubview:subTitleLabel];
UILabel *priceLabel = [UILabel new];
priceLabel.text = dataModel.price;
priceLabel.font = [UIFont systemFontOfSize:11];
priceLabel.textColor = [UIColor redColor];
priceLabel.myLeftMargin = 5;
priceLabel.myBottomMargin = 5;
[priceLabel sizeToFit];
priceLabel.reverseFloat = YES;
[itemLayout addSubview:priceLabel];
UILabel *descLabel = [UILabel new];
descLabel.text = dataModel.desc;
descLabel.font = [UIFont systemFontOfSize:11];
descLabel.textColor = [UIColor lightGrayColor];
descLabel.myLeftMargin = 5;
[descLabel sizeToFit];
descLabel.reverseFloat = YES;
[itemLayout addSubview:descLabel];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:dataModel.image]];
imageView.widthDime.equalTo(itemLayout.widthDime);
imageView.weight = 1;
[itemLayout addSubview:imageView];
return itemLayout;
}
-(MyFloatLayout*)createItemLayout3_2:(TBDataModel*)dataModel
{
MyFloatLayout *itemLayout = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Horz];
UILabel *titleLabel = [UILabel new];
titleLabel.text = dataModel.title;
titleLabel.font = [UIFont boldSystemFontOfSize:15];
titleLabel.myLeftMargin = 5;
titleLabel.myTopMargin = 5;
titleLabel.widthDime.equalTo(itemLayout.widthDime).multiply(0.5);
[titleLabel sizeToFit];
[itemLayout addSubview:titleLabel];
UILabel *subTitleLabel = [UILabel new];
subTitleLabel.text = dataModel.subTitle;
subTitleLabel.font = [UIFont systemFontOfSize:11];
subTitleLabel.myLeftMargin = 5;
subTitleLabel.myTopMargin = 5;
[subTitleLabel sizeToFit];
subTitleLabel.widthDime.equalTo(itemLayout.widthDime).multiply(0.5);
[itemLayout addSubview:subTitleLabel];
UILabel *priceLabel = [UILabel new];
priceLabel.text = dataModel.price;
priceLabel.font = [UIFont systemFontOfSize:11];
priceLabel.textColor = [UIColor redColor];
priceLabel.myLeftMargin = 5;
priceLabel.myBottomMargin = 5;
[priceLabel sizeToFit];
priceLabel.reverseFloat = YES;
priceLabel.widthDime.equalTo(itemLayout.widthDime).multiply(0.5);
[itemLayout addSubview:priceLabel];
UILabel *descLabel = [UILabel new];
descLabel.text = dataModel.desc;
descLabel.font = [UIFont systemFontOfSize:11];
descLabel.textColor = [UIColor lightGrayColor];
descLabel.myLeftMargin = 5;
[descLabel sizeToFit];
descLabel.reverseFloat = YES;
descLabel.widthDime.equalTo(itemLayout.widthDime).multiply(0.5);
[itemLayout addSubview:descLabel];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:dataModel.image]];
imageView.widthDime.equalTo(itemLayout.widthDime).multiply(0.5);
imageView.heightDime.equalTo(itemLayout.heightDime);
[itemLayout addSubview:imageView];
return itemLayout;
}
-(MyFloatLayout*)createItemLayout4_1:(TBDataModel*)dataModel
{
MyFloatLayout *itemLayout = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Horz];
UILabel *titleLabel = [UILabel new];
titleLabel.text = dataModel.title;
titleLabel.font = [UIFont boldSystemFontOfSize:15];
titleLabel.myLeftMargin = 5;
titleLabel.myTopMargin = 5;
titleLabel.widthDime.equalTo(itemLayout.widthDime).multiply(0.5);
[titleLabel sizeToFit];
[itemLayout addSubview:titleLabel];
UILabel *subTitleLabel = [UILabel new];
subTitleLabel.text = dataModel.subTitle;
subTitleLabel.font = [UIFont systemFontOfSize:11];
subTitleLabel.myLeftMargin = 5;
subTitleLabel.myTopMargin = 5;
[subTitleLabel sizeToFit];
subTitleLabel.widthDime.equalTo(itemLayout.widthDime).multiply(0.5);
[itemLayout addSubview:subTitleLabel];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:dataModel.image]];
imageView.widthDime.equalTo(itemLayout.widthDime).multiply(0.5);
imageView.heightDime.equalTo(itemLayout.heightDime);
[itemLayout addSubview:imageView];
return itemLayout;
}
-(MyFloatLayout*)createItemLayout4_2:(TBDataModel*)dataModel
{
MyFloatLayout *itemLayout = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Horz];
UILabel *titleLabel = [UILabel new];
titleLabel.text = dataModel.title;
titleLabel.font = [UIFont boldSystemFontOfSize:15];
titleLabel.myLeftMargin = 5;
titleLabel.myTopMargin = 5;
[titleLabel sizeToFit];
[itemLayout addSubview:titleLabel];
UILabel *subTitleLabel = [UILabel new];
subTitleLabel.text = dataModel.subTitle;
subTitleLabel.font = [UIFont systemFontOfSize:11];
subTitleLabel.myLeftMargin = 5;
subTitleLabel.myTopMargin = 5;
[subTitleLabel sizeToFit];
[itemLayout addSubview:subTitleLabel];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:dataModel.image]];
imageView.widthDime.equalTo(itemLayout.widthDime);
imageView.weight = 1;
[itemLayout addSubview:imageView];
return itemLayout;
}
-(MyFloatLayout*)createItemLayout5_1:(TBDataModel*)dataModel
{
MyFloatLayout *itemLayout = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Horz];
UILabel *titleLabel = [UILabel new];
titleLabel.text = dataModel.title;
titleLabel.font = [UIFont boldSystemFontOfSize:15];
titleLabel.myLeftMargin = 5;
titleLabel.myTopMargin = 5;
[titleLabel sizeToFit];
[itemLayout addSubview:titleLabel];
UILabel *subTitleLabel = [UILabel new];
subTitleLabel.text = dataModel.subTitle;
subTitleLabel.font = [UIFont systemFontOfSize:11];
subTitleLabel.textColor = [UIColor redColor];
subTitleLabel.myLeftMargin = 5;
subTitleLabel.myTopMargin = 5;
[subTitleLabel sizeToFit];
[itemLayout addSubview:subTitleLabel];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:dataModel.image]];
imageView.widthDime.equalTo(itemLayout.widthDime);
imageView.weight = 1; //图片占用剩余的全部高度
[itemLayout addSubview:imageView];
return itemLayout;
}
//其他布局
-(void)loadView
{
[super loadView];
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];
self.view = scrollView;
self.rootLayout = [MyLinearLayout linearLayoutWithOrientation:MyLayoutViewOrientation_Vert];
self.rootLayout.myLeftMargin = self.rootLayout.myRightMargin = 0;
self.rootLayout.gravity = MyMarginGravity_Horz_Fill;
self.rootLayout.backgroundColor = [UIColor colorWithWhite:0xe7/255.0 alpha:1];
self.rootLayout.IntelligentBorderLine = [[MyBorderLineDraw alloc] initWithColor:[UIColor lightGrayColor]]; //智能边界线
[scrollView addSubview:self.rootLayout];
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.title = @"仿天猫淘宝首页布局";
//数据模型
TBDataModel *d1_1 = [TBDataModel new];
d1_1.title = @"品牌特卖";
d1_1.image = @"p1-11";
d1_1.subImage = @"p1-12";
TBDataModel *d1_31 = [TBDataModel new];
d1_31.title = @"焕新";
d1_31.subTitle = @"海军风荷叶摆";
d1_31.image = @"p1-31";
d1_31.subImage = @"p1-36";
TBDataModel *d1_32 = [TBDataModel new];
d1_32.title = @"必抢";
d1_32.subTitle = @"购物券翻倍减最高立减100元";
d1_32.image = @"p1-32";
TBDataModel *d1_2 = [TBDataModel new];
d1_2.title = @"天猫超市";
d1_2.subTitle = @"买2付1再送电动牙刷";
d1_2.image = @"p1-21";
TBDataModel *d1_33 = [TBDataModel new];
d1_33.title = @"全球精选";
d1_33.subTitle = @"line限量气垫99元";
d1_33.image = @"p1-33";
d1_33.subImage = @"p1-36";
TBDataModel *d1_34 = [TBDataModel new];
d1_34.title = @"苏宁易购";
d1_34.subTitle = @"iPhone SE 全网通新产品发售 原封全国";
d1_34.image = @"p1-34";
TBDataModel *d1_35 = [TBDataModel new];
d1_35.title = @"免费试用";
d1_35.subTitle = @"欧美范儿显瘦T裙春日新装";
d1_35.image = @"p1-35";
//品牌日
TBDataModel *d2_1 = [TBDataModel new];
d2_1.image = @"p2-1";
TBDataModel *d2_2 = [TBDataModel new];
d2_2.image = @"p2-3";
TBDataModel *d2_3 = [TBDataModel new];
d2_3.image = @"p2-3";
TBDataModel *d2_4 = [TBDataModel new];
d2_4.image = @"p2-4";
TBDataModel *d3_1 = [TBDataModel new];
d3_1.title = @"天天搞机";
d3_1.subTitle = @"小米5开售";
d3_1.image = @"p3-1";
d3_1.desc = @"10点开抢";
d3_1.price = @"¥1999";
TBDataModel *d3_21 = [TBDataModel new];
d3_21.title = @"全球时尚";
d3_21.subTitle = @"大牌精致时尚";
d3_21.image = @"p3-21";
d3_21.desc = @"清新小花";
d3_21.price = @"";
TBDataModel *d3_22 = [TBDataModel new];
d3_22.title = @"物色";
d3_22.subTitle = @"每日惊喜主题";
d3_22.image = @"p3-22";
d3_22.desc = @"减龄背带裤";
d3_22.price = @"¥189";
TBDataModel *d3_23 = [TBDataModel new];
d3_23.title = @"生活家";
d3_23.subTitle = @"好生活并不贵";
d3_23.image = @"p3-23";
d3_23.desc = @"樱花手机壳";
d3_23.price = @"¥37";
TBDataModel *d3_24 = [TBDataModel new];
d3_24.title = @"喵鲜生";
d3_24.subTitle = @"全进口好生鲜";
d3_24.image = @"p3-24";
d3_24.desc = @"抢无门槛红包";
d3_24.price = @"¥49";
TBDataModel *d4_11 = [TBDataModel new];
d4_11.title = @"天猫女装";
d4_11.subTitle = @"大牌1折起";
d4_11.image = @"p4-11";
TBDataModel *d4_12 = [TBDataModel new];
d4_12.title = @"天猫男装";
d4_12.subTitle = @"商场同款5折";
d4_12.image = @"p4-12";
TBDataModel *d4_21 = [TBDataModel new];
d4_21.title = @"鞋履";
d4_21.subTitle = @"寒冬不再冷";
d4_21.image = @"p4-21";
TBDataModel *d4_22 = [TBDataModel new];
d4_22.title = @"母婴玩具";
d4_22.subTitle = @"新年新装备";
d4_22.image = @"p4-22";
TBDataModel *d4_23 = [TBDataModel new];
d4_23.title = @"美妆";
d4_23.subTitle = @"新春送礼";
d4_23.image = @"p4-23";
TBDataModel *d4_24 = [TBDataModel new];
d4_24.title = @"电器城";
d4_24.subTitle = @"工夫熊猫来啦";
d4_24.image = @"p4-24";
TBDataModel *d5_1 = [TBDataModel new];
d5_1.title = @"布置小家";
d5_1.subTitle = @"格调摆件低价";
d5_1.image = @"p5-1";
TBDataModel *d5_2 = [TBDataModel new];
d5_2.title = @"疯狂吃货";
d5_2.subTitle = @"零食9元起";
d5_2.image = @"p5-2";
TBDataModel *d5_3 = [TBDataModel new];
d5_3.title = @"妈咪萌宝";
d5_3.subTitle = @"为宝贝超划算";
d5_3.image = @"p5-3";
TBDataModel *d5_4 = [TBDataModel new];
d5_4.title = @"有车一族";
d5_4.subTitle = @"爱车装备优惠";
d5_4.image = @"p5-4";
//平台特卖模型布局。每个条目的高度为50
//这里的所有条目布局都用浮动布局,是为了展示浮动布局的使用。但实际中可以使用其他的布局。
CGFloat itemHeight = 90;
//品牌特卖
MyFloatLayout *layout1 = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Vert];
layout1.backgroundColor = [UIColor whiteColor];
layout1.wrapContentHeight = YES;
layout1.IntelligentBorderLine = [[MyBorderLineDraw alloc] initWithColor:[UIColor lightGrayColor]];
[self.rootLayout addSubview:layout1];
MyBaseLayout *itemLayout = [self createItemLayout1_1:d1_1];
itemLayout.heightDime.equalTo(@(itemHeight*2));
itemLayout.widthDime.equalTo(layout1.widthDime).multiply(0.5);
[layout1 addSubview:itemLayout];
itemLayout = [self createItemLayout1_3:d1_31];
itemLayout.heightDime.equalTo(@(itemHeight));
itemLayout.widthDime.equalTo(layout1.widthDime).multiply(0.5);
[layout1 addSubview:itemLayout];
itemLayout = [self createItemLayout1_3:d1_32];
itemLayout.heightDime.equalTo(@(itemHeight));
itemLayout.widthDime.equalTo(layout1.widthDime).multiply(0.5);
[layout1 addSubview:itemLayout];
itemLayout = [self createItemLayout1_2:d1_2];
itemLayout.heightDime.equalTo(@(itemHeight));
itemLayout.widthDime.equalTo(layout1.widthDime).multiply(0.5);
[layout1 addSubview:itemLayout];
itemLayout = [self createItemLayout1_3:d1_33];
itemLayout.heightDime.equalTo(@(itemHeight));
itemLayout.widthDime.equalTo(layout1.widthDime).multiply(0.5);
[layout1 addSubview:itemLayout];
itemLayout = [self createItemLayout1_3:d1_34];
itemLayout.heightDime.equalTo(@(itemHeight));
itemLayout.widthDime.equalTo(layout1.widthDime).multiply(0.5);
[layout1 addSubview:itemLayout];
itemLayout = [self createItemLayout1_3:d1_35];
itemLayout.heightDime.equalTo(@(itemHeight));
itemLayout.widthDime.equalTo(layout1.widthDime).multiply(0.5);
[layout1 addSubview:itemLayout];
//超级品牌日
UILabel *label = [UILabel new];
label.text = @"超级品牌日";
label.backgroundColor = [UIColor whiteColor];
label.font = [UIFont boldSystemFontOfSize:15];
label.myHeight = 30;
label.myTopMargin = 10;
[self.rootLayout addSubview:label];
MyFloatLayout *layout2 = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Vert];
layout2.backgroundColor = [UIColor whiteColor];
layout2.wrapContentHeight = YES;
layout2.IntelligentBorderLine = [[MyBorderLineDraw alloc] initWithColor:[UIColor lightGrayColor]];
[self.rootLayout addSubview:layout2];
itemLayout = [self createItemLayout2_1:d2_1];
itemLayout.widthDime.equalTo(layout2.widthDime).multiply(0.5);
itemLayout.heightDime.equalTo(@(itemHeight * 2));
[layout2 addSubview:itemLayout];
itemLayout = [self createItemLayout2_1:d2_2];
itemLayout.widthDime.equalTo(layout2.widthDime).multiply(0.25);
itemLayout.heightDime.equalTo(@(itemHeight * 2));
[layout2 addSubview:itemLayout];
itemLayout = [self createItemLayout2_1:d2_3];
itemLayout.widthDime.equalTo(layout2.widthDime).multiply(0.25);
itemLayout.heightDime.equalTo(@(itemHeight * 2));
[layout2 addSubview:itemLayout];
itemLayout = [self createItemLayout2_1:d2_4];
itemLayout.widthDime.equalTo(layout2.widthDime);
itemLayout.heightDime.equalTo(@(itemHeight));
itemLayout.notUseIntelligentBorderLine = YES;
[layout2 addSubview:itemLayout];
//精选市场
label = [UILabel new];
label.text = @"精选市场";
label.backgroundColor = [UIColor whiteColor];
label.font = [UIFont boldSystemFontOfSize:15];
label.myHeight = 30;
label.myTopMargin = 10;
[self.rootLayout addSubview:label];
MyFloatLayout *layout3 = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Vert];
layout3.backgroundColor = [UIColor whiteColor];
layout3.wrapContentHeight = YES;
layout3.IntelligentBorderLine = [[MyBorderLineDraw alloc] initWithColor:[UIColor lightGrayColor]];
[self.rootLayout addSubview:layout3];
itemLayout = [self createItemLayout3_1:d3_1];
itemLayout.heightDime.equalTo(@(itemHeight * 2));
itemLayout.widthDime.equalTo(layout3.widthDime).multiply(0.4);
[layout3 addSubview:itemLayout];
itemLayout = [self createItemLayout3_2:d3_21];
itemLayout.heightDime.equalTo(@(itemHeight));
itemLayout.widthDime.equalTo(layout3.widthDime).multiply(0.6);
[layout3 addSubview:itemLayout];
itemLayout = [self createItemLayout3_2:d3_22];
itemLayout.heightDime.equalTo(@(itemHeight));
itemLayout.widthDime.equalTo(layout3.widthDime).multiply(0.6);
[layout3 addSubview:itemLayout];
itemLayout = [self createItemLayout3_2:d3_23];
itemLayout.heightDime.equalTo(@(itemHeight));
itemLayout.widthDime.equalTo(layout3.widthDime).multiply(0.4);
[layout3 addSubview:itemLayout];
itemLayout = [self createItemLayout3_2:d3_24];
itemLayout.heightDime.equalTo(@(itemHeight));
itemLayout.widthDime.equalTo(layout3.widthDime).multiply(0.6);
[layout3 addSubview:itemLayout];
//热门市场
label = [UILabel new];
label.text = @"热门市场";
label.backgroundColor = [UIColor whiteColor];
label.font = [UIFont boldSystemFontOfSize:15];
label.myHeight = 30;
label.myTopMargin = 10;
[self.rootLayout addSubview:label];
MyFloatLayout *layout4 = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Vert];
layout4.backgroundColor = [UIColor whiteColor];
layout4.wrapContentHeight = YES;
layout4.IntelligentBorderLine = [[MyBorderLineDraw alloc] initWithColor:[UIColor lightGrayColor]];
[self.rootLayout addSubview:layout4];
itemLayout = [self createItemLayout4_1:d4_11];
itemLayout.widthDime.equalTo(layout4.widthDime).multiply(0.5);
itemLayout.heightDime.equalTo(@(itemHeight));
[layout4 addSubview:itemLayout];
itemLayout = [self createItemLayout4_1:d4_12];
itemLayout.widthDime.equalTo(layout4.widthDime).multiply(0.5);
itemLayout.heightDime.equalTo(@(itemHeight));
[layout4 addSubview:itemLayout];
itemLayout = [self createItemLayout4_2:d4_21];
itemLayout.widthDime.equalTo(layout4.widthDime).multiply(0.25);
itemLayout.heightDime.equalTo(@(itemHeight + 20));
[layout4 addSubview:itemLayout];
itemLayout = [self createItemLayout4_2:d4_22];
itemLayout.widthDime.equalTo(layout4.widthDime).multiply(0.25);
itemLayout.heightDime.equalTo(@(itemHeight + 20));
[layout4 addSubview:itemLayout];
itemLayout = [self createItemLayout4_2:d4_23];
itemLayout.widthDime.equalTo(layout4.widthDime).multiply(0.25);
itemLayout.heightDime.equalTo(@(itemHeight + 20));
[layout4 addSubview:itemLayout];
itemLayout = [self createItemLayout4_2:d4_24];
itemLayout.widthDime.equalTo(layout4.widthDime).multiply(0.25);
itemLayout.heightDime.equalTo(@(itemHeight + 20));
[layout4 addSubview:itemLayout];
//主题市场
label = [UILabel new];
label.text = @"主题市场";
label.font = [UIFont boldSystemFontOfSize:15];
label.backgroundColor = [UIColor whiteColor];
label.myHeight = 30;
label.myTopMargin = 10;
[self.rootLayout addSubview:label];
MyFloatLayout *layout5 = [MyFloatLayout floatLayoutWithOrientation:MyLayoutViewOrientation_Vert];
layout5.backgroundColor = [UIColor whiteColor];
layout5.wrapContentHeight = YES;
layout5.IntelligentBorderLine = [[MyBorderLineDraw alloc] initWithColor:[UIColor lightGrayColor]];
[self.rootLayout addSubview:layout5];
itemLayout = [self createItemLayout5_1:d5_1];
itemLayout.widthDime.equalTo(layout5.widthDime).multiply(0.25);
itemLayout.heightDime.equalTo(@(itemHeight + 20));
[layout5 addSubview:itemLayout];
itemLayout = [self createItemLayout5_1:d5_2];
itemLayout.widthDime.equalTo(layout5.widthDime).multiply(0.25);
itemLayout.heightDime.equalTo(@(itemHeight + 20));
[layout5 addSubview:itemLayout];
itemLayout = [self createItemLayout5_1:d5_3];
itemLayout.widthDime.equalTo(layout5.widthDime).multiply(0.25);
itemLayout.heightDime.equalTo(@(itemHeight + 20));
[layout5 addSubview:itemLayout];
itemLayout = [self createItemLayout5_1:d5_4];
itemLayout.widthDime.equalTo(layout5.widthDime).multiply(0.25);
itemLayout.heightDime.equalTo(@(itemHeight + 20));
[layout5 addSubview:itemLayout];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
You can’t perform that action at this time.
