12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- //
- // FKInvalidView.m
- // FirstLink
- //
- // Created by jack on 16/7/19.
- // Copyright © 2016年 FirstLink. All rights reserved.
- //
- #import "FKInvalidView.h"
- #define InvalidViewMargin 44
- @implementation FKInvalidView
- - (instancetype)initWithFrame:(CGRect)frame{
- if (self = [super initWithFrame:CGRectMake(frame.origin.x, frame.origin.y, InvalidViewMargin, InvalidViewMargin)]) {
- [self initializeLayout];
- }
- return self;
- }
- - (CGSize)intrinsicContentSize{
- return CGSizeMake(InvalidViewMargin, InvalidViewMargin);
- }
- - (void)initializeLayout{
-
- self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
- self.layer.cornerRadius = 22;
-
- [self addSubview:self.titleLabel];
- [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.center.equalTo(self);
- }];
- }
- - (UILabel *)titleLabel{
- if (_titleLabel == nil) {
- _titleLabel = [[UILabel alloc]init];
- _titleLabel.font= [UIFont systemFontOfSize:10];
- _titleLabel.textColor = UIColorFromRGB(0xffffff);
- }
- return _titleLabel;
- }
- @end
|