-
Notifications
You must be signed in to change notification settings - Fork 28
/
IndicatorView.m
34 lines (27 loc) · 1.26 KB
/
IndicatorView.m
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
//
// IndicatorView.m
// LCAnimatedPageControl
//
// Created by beike on 8/14/15.
// Copyright (c) 2015 beike. All rights reserved.
//
#import "IndicatorView.h"
@implementation IndicatorView
- (instancetype)init{
self = [super init];
if (self) {
_frontView = [[UIView alloc] init];
_backView = [[UIView alloc] init];
_frontView.translatesAutoresizingMaskIntoConstraints = NO;
_backView.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_backView];
[self addSubview:_frontView];
NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings(_frontView, _backView);
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[_frontView]-0-|" options:0 metrics:nil views:viewsDictionary]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[_frontView]-0-|" options:0 metrics:nil views:viewsDictionary]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[_backView]-0-|" options:0 metrics:nil views:viewsDictionary]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[_backView]-0-|" options:0 metrics:nil views:viewsDictionary]];
}
return self;
}
@end