-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathAboutPointViewController.m
More file actions
43 lines (36 loc) · 1.54 KB
/
AboutPointViewController.m
File metadata and controls
43 lines (36 loc) · 1.54 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
//
// AboutPointViewController.m
// Coding_iOS
//
// Created by Easeeeeeeeee on 2017/9/18.
// Copyright © 2017年 Coding. All rights reserved.
//
#import "AboutPointViewController.h"
@interface AboutPointViewController ()
@property (weak, nonatomic) IBOutlet UILabel *aboutL;
@end
@implementation AboutPointViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.title = @"关于码币";
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:_aboutL.text];
//段落
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
[paragraphStyle setLineSpacing:5.0];
// [paragraphStyle setParagraphSpacing:10];
[paragraphStyle setLineBreakMode:_aboutL.lineBreakMode];
[paragraphStyle setAlignment:_aboutL.textAlignment];
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [_aboutL.text length])];
//标题
NSArray *titleList = @[@"什么是码币", @"码币的用途", @"如何获取码币"];
for (NSString *title in titleList) {
NSRange textR = [_aboutL.text rangeOfString:title];
if (textR.location != NSNotFound) {
[attributedString addAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:15 weight:UIFontWeightMedium],
NSForegroundColorAttributeName: kColorDark3} range:textR];
}
}
_aboutL.attributedText = attributedString;
}
@end