SearchDeviceCell.m 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // SearchDeviceCell.m
  3. // FunSDKDemo
  4. //
  5. // Created by wujiangbo on 2018/11/15.
  6. // Copyright © 2018年 wujiangbo. All rights reserved.
  7. //
  8. #import "SearchDeviceCell.h"
  9. #import <Masonry/Masonry.h>
  10. @implementation SearchDeviceCell
  11. #pragma mark - lazyload
  12. -(UILabel *)nameLab {
  13. if (!_nameLab) {
  14. _nameLab = [[UILabel alloc] init];
  15. _nameLab.textColor = [UIColor blackColor];
  16. _nameLab.font = [UIFont boldSystemFontOfSize:15];
  17. }
  18. return _nameLab;
  19. }
  20. -(UILabel *)serialNumLab {
  21. if (!_serialNumLab) {
  22. _serialNumLab = [[UILabel alloc] init];
  23. _serialNumLab.textColor = [UIColor blackColor];
  24. _serialNumLab.font = [UIFont systemFontOfSize:13 weight:UIFontWeightLight];
  25. }
  26. return _serialNumLab;
  27. }
  28. -(UILabel *)ipLab {
  29. if (!_ipLab) {
  30. _ipLab = [[UILabel alloc] init];
  31. _ipLab.textColor = [UIColor blackColor];
  32. _ipLab.font = [UIFont systemFontOfSize:13 weight:UIFontWeightLight];
  33. }
  34. return _ipLab;
  35. }
  36. #pragma mark - 设置坐标
  37. -(void)makeUI {
  38. [self.contentView addSubview:self.nameLab];
  39. [self.contentView addSubview:self.serialNumLab];
  40. [self.contentView addSubview:self.ipLab];
  41. [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
  42. make.left.equalTo(self.contentView).offset(10);
  43. make.width.equalTo(@300);
  44. make.height.equalTo(@20);
  45. make.top.equalTo(self.contentView).offset(5);
  46. }];
  47. [self.serialNumLab mas_makeConstraints:^(MASConstraintMaker *make) {
  48. make.left.equalTo(self.contentView).offset(10);
  49. make.width.equalTo(@300);
  50. make.height.equalTo(@20);
  51. make.top.equalTo(self.nameLab.mas_bottom).offset(5);
  52. }];
  53. [self.ipLab mas_makeConstraints:^(MASConstraintMaker *make) {
  54. make.left.equalTo(self.contentView).offset(10);
  55. make.width.equalTo(@300);
  56. make.height.equalTo(@20);
  57. make.top.equalTo(self.serialNumLab.mas_bottom).offset(5);
  58. }];
  59. }
  60. #pragma mark - 初始化
  61. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  62. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  63. if (self) {
  64. [self makeUI];
  65. }
  66. return self;
  67. }
  68. @end