|
7 | 7 | // |
8 | 8 |
|
9 | 9 | #import "AboutViewController.h" |
| 10 | +#import <Masonry/Masonry.h> |
10 | 11 |
|
11 | 12 | @interface AboutViewController () |
12 | | -@property (strong, nonatomic) UIImageView *logoView; |
13 | | -@property (strong, nonatomic) UILabel *logoLabel, *versionLabel, *infoLabel; |
14 | 13 | @end |
15 | 14 |
|
16 | 15 | @implementation AboutViewController |
@@ -42,35 +41,84 @@ - (void)loadView{ |
42 | 41 | self.title = @"关于Coding"; |
43 | 42 | self.view.backgroundColor = [UIColor colorWithHexString:@"0xe5e5e5"]; |
44 | 43 |
|
45 | | - _logoView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo_about"]]; |
46 | | - [_logoView setCenter:CGPointMake(kScreen_Width/2, 36+CGRectGetMidY(_logoView.bounds))]; |
47 | | - [self.view addSubview:_logoView]; |
| 44 | + UIImageView *logoView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo_about"]]; |
| 45 | + [self.view addSubview:logoView]; |
| 46 | + |
| 47 | + UILabel *logoLabel = [[UILabel alloc] init]; |
| 48 | + logoLabel.font = [UIFont boldSystemFontOfSize:17]; |
| 49 | + logoLabel.textColor = [UIColor colorWithHexString:@"0x222222"]; |
| 50 | + logoLabel.textAlignment = NSTextAlignmentCenter; |
| 51 | + logoLabel.text = @"Coding-让开发更简单"; |
| 52 | + [self.view addSubview:logoLabel]; |
| 53 | + |
| 54 | + UILabel *versionLabel = [[UILabel alloc] init]; |
| 55 | + versionLabel.font = [UIFont systemFontOfSize:12]; |
| 56 | + versionLabel.textColor = [UIColor colorWithHexString:@"0x666666"]; |
| 57 | + versionLabel.textAlignment = NSTextAlignmentCenter; |
| 58 | + versionLabel.text = [NSString stringWithFormat:@"版本:V%@", kVersion_Coding]; |
| 59 | + [self.view addSubview:versionLabel]; |
48 | 60 |
|
49 | | - _logoLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(_logoView.frame), kScreen_Width, 30)]; |
50 | | - _logoLabel.backgroundColor = [UIColor clearColor]; |
51 | | - _logoLabel.font = [UIFont boldSystemFontOfSize:17]; |
52 | | - _logoLabel.textColor = [UIColor colorWithHexString:@"0x000000"]; |
53 | | - _logoLabel.textAlignment = NSTextAlignmentCenter; |
54 | | - _logoLabel.text = @"coding-让开发更简单"; |
55 | | - [self.view addSubview:_logoLabel]; |
56 | 61 |
|
57 | | - _versionLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(_logoLabel.frame), kScreen_Width, 20)]; |
58 | | - _versionLabel.backgroundColor = [UIColor clearColor]; |
59 | | - _versionLabel.font = [UIFont systemFontOfSize:12]; |
60 | | - _versionLabel.textColor = [UIColor colorWithHexString:@"0x666666"]; |
61 | | - _versionLabel.textAlignment = NSTextAlignmentCenter; |
62 | | - _versionLabel.text = [NSString stringWithFormat:@"版本:V%@", kVersion_Coding]; |
63 | | - [self.view addSubview:_versionLabel]; |
64 | 62 |
|
65 | | -// _infoLabel = [[UILabel alloc] initWithFrame:CGRectMake(80, kScreen_Height-100, kScreen_Width, 100)]; |
66 | | - _infoLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, kScreen_Height-180, kScreen_Width, 100)]; |
67 | | - _infoLabel.numberOfLines = 0; |
68 | | - _infoLabel.backgroundColor = [UIColor clearColor]; |
69 | | - _infoLabel.font = [UIFont systemFontOfSize:12]; |
70 | | - _infoLabel.textColor = [UIColor colorWithHexString:@"0x222222"]; |
71 | | - _infoLabel.textAlignment = NSTextAlignmentLeft; |
72 | | - _infoLabel. text = [ NSString stringWithFormat:@"官网:https://coding.net \nE-mail:[email protected] \n微博:Coding \n微信:扣钉Coding"]; |
73 | | - [self.view addSubview:_infoLabel]; |
| 63 | + UILabel *infoLabel1 = [[UILabel alloc] init]; |
| 64 | + infoLabel1.numberOfLines = 0; |
| 65 | + infoLabel1.backgroundColor = [UIColor clearColor]; |
| 66 | + infoLabel1.font = [UIFont systemFontOfSize:12]; |
| 67 | + infoLabel1.textColor = [UIColor colorWithHexString:@"0x666666"]; |
| 68 | + infoLabel1.textAlignment = NSTextAlignmentRight; |
| 69 | + infoLabel1.text = [NSString stringWithFormat:@"官网:\nE-mail:\n微博:\n微信:"]; |
| 70 | + [self.view addSubview:infoLabel1]; |
| 71 | + |
| 72 | + UILabel *infoLabel2 = [[UILabel alloc] init]; |
| 73 | + infoLabel2.numberOfLines = 0; |
| 74 | + infoLabel2.backgroundColor = [UIColor clearColor]; |
| 75 | + infoLabel2.font = [UIFont systemFontOfSize:12]; |
| 76 | + infoLabel2.textColor = [UIColor colorWithHexString:@"0x666666"]; |
| 77 | + infoLabel2.textAlignment = NSTextAlignmentLeft; |
| 78 | + infoLabel2. text = [ NSString stringWithFormat:@"https://coding.net \n[email protected] \nCoding \n扣钉Coding"]; |
| 79 | + [self.view addSubview:infoLabel2]; |
| 80 | + |
74 | 81 |
|
| 82 | + UILabel *copyrightLabel = [[UILabel alloc] init]; |
| 83 | + copyrightLabel.font = [UIFont systemFontOfSize:12]; |
| 84 | + copyrightLabel.textColor = [UIColor colorWithHexString:@"0x666666"]; |
| 85 | + copyrightLabel.textAlignment = NSTextAlignmentCenter; |
| 86 | + copyrightLabel.text = [NSString stringWithFormat:@"Copyright © 2015 Coding.net"]; |
| 87 | + [self.view addSubview:copyrightLabel]; |
| 88 | + |
| 89 | + [logoView mas_makeConstraints:^(MASConstraintMaker *make) { |
| 90 | + make.top.equalTo(self.view.mas_top).offset(40); |
| 91 | + make.centerX.equalTo(self.view.mas_centerX); |
| 92 | + }]; |
| 93 | + [logoLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
| 94 | + make.top.equalTo(logoView.mas_bottom).offset(15); |
| 95 | + make.left.right.equalTo(self.view); |
| 96 | + make.height.mas_equalTo(logoLabel.font.pointSize); |
| 97 | + }]; |
| 98 | + [versionLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
| 99 | + make.top.equalTo(logoLabel.mas_bottom).offset(20); |
| 100 | + make.left.right.equalTo(self.view); |
| 101 | + make.height.mas_equalTo(versionLabel.font.pointSize); |
| 102 | + }]; |
| 103 | + |
| 104 | + [infoLabel1 mas_makeConstraints:^(MASConstraintMaker *make) { |
| 105 | + make.bottom.equalTo(copyrightLabel.mas_top).offset(-20); |
| 106 | + make.left.mas_equalTo(self.view.mas_left); |
| 107 | + make.right.equalTo(self.view.mas_centerX).offset(-20); |
| 108 | + make.height.mas_equalTo(60); |
| 109 | + }]; |
| 110 | + |
| 111 | + [infoLabel2 mas_makeConstraints:^(MASConstraintMaker *make) { |
| 112 | + make.bottom.equalTo(copyrightLabel.mas_top).offset(-20); |
| 113 | + make.left.mas_equalTo(infoLabel1.mas_right); |
| 114 | + make.right.equalTo(self.view.mas_right); |
| 115 | + make.height.mas_equalTo(60); |
| 116 | + }]; |
| 117 | + |
| 118 | + [copyrightLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
| 119 | + make.bottom.equalTo(self.view.mas_bottom).offset(-20); |
| 120 | + make.left.right.equalTo(self.view); |
| 121 | + make.height.mas_equalTo(20); |
| 122 | + }]; |
75 | 123 | } |
76 | 124 | @end |
0 commit comments