Aucune description

FKInvalidView.m 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // FKInvalidView.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/7/19.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKInvalidView.h"
  9. #define InvalidViewMargin 44
  10. @implementation FKInvalidView
  11. - (instancetype)initWithFrame:(CGRect)frame{
  12. if (self = [super initWithFrame:CGRectMake(frame.origin.x, frame.origin.y, InvalidViewMargin, InvalidViewMargin)]) {
  13. [self initializeLayout];
  14. }
  15. return self;
  16. }
  17. - (CGSize)intrinsicContentSize{
  18. return CGSizeMake(InvalidViewMargin, InvalidViewMargin);
  19. }
  20. - (void)initializeLayout{
  21. self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
  22. self.layer.cornerRadius = 22;
  23. [self addSubview:self.titleLabel];
  24. [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  25. make.center.equalTo(self);
  26. }];
  27. }
  28. - (UILabel *)titleLabel{
  29. if (_titleLabel == nil) {
  30. _titleLabel = [[UILabel alloc]init];
  31. _titleLabel.font= [UIFont systemFontOfSize:10];
  32. _titleLabel.textColor = UIColorFromRGB(0xffffff);
  33. }
  34. return _titleLabel;
  35. }
  36. @end