developer
2023-05-20 e12c7b4c22df631ebdcd16b2f98fbef8f738f92f
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
//
//  CRLineView.m
//  CRBoxInputView_Example
//
//  Created by Chobits on 2019/6/10.
//  Copyright © 2019 BearRan. All rights reserved.
//
 
#import "CRLineView.h"
#import <Masonry/Masonry.h>
 
@interface CRLineView()
{
    
}
@end
 
@implementation CRLineView
 
- (instancetype)init
{
    self = [super init];
    if (self) {
        [self createUI];
    }
    return self;
}
 
- (void)createUI
{
    static CGFloat sepLineViewHeight = 4;
    
    _lineView = [UIView new];
    [self addSubview:_lineView];
    _lineView.backgroundColor = [UIColor blackColor];
    _lineView.layer.cornerRadius = sepLineViewHeight / 2.0;
    [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(sepLineViewHeight);
        make.left.right.bottom.offset(0);
    }];
    
    _lineView.layer.shadowColor = [[UIColor blackColor] colorWithAlphaComponent:0.2].CGColor;
    _lineView.layer.shadowOpacity = 1;
    _lineView.layer.shadowOffset = CGSizeMake(0, 2);
    _lineView.layer.shadowRadius = 4;
}
 
@end