YOUPAILCGPSCityCell.m 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // YOUPAILCGPSCityCell.m
  3. // LiveChat
  4. //
  5. // Created by 张灿 on 2018/4/21.
  6. // Copyright © 2018年 caicai. All rights reserved.
  7. //
  8. #import "YOUPAILCGPSCityCell.h"
  9. @implementation YOUPAILCGPSCityCell
  10. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  11. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  12. self.selectionStyle = UITableViewCellSelectionStyleNone;
  13. self.backgroundColor = [UIColor clearColor];
  14. [self youpaifinitUI];
  15. }
  16. return self;
  17. }
  18. - (void)youpaifinitUI{
  19. self.youpaipcityLabel = [[UILabel alloc]init];
  20. self.youpaipcityLabel.font = LCFont14;
  21. self.youpaipcityLabel.textColor = LZ273145Color;
  22. self.youpaipcityLabel.textAlignment = NSTextAlignmentLeft;
  23. [self.contentView addSubview:self.youpaipcityLabel];
  24. [self.youpaipcityLabel makeConstraints:^(MASConstraintMaker *make) {
  25. make.left.equalTo(self.left).offset(15);
  26. make.top.equalTo(@14);
  27. make.height.equalTo(@20);
  28. }];
  29. self.youpaipgpsBtn = [[UIButton alloc]init];
  30. self.youpaipgpsBtn.titleLabel.font = LCFont15;
  31. [self.youpaipgpsBtn setTitleColor:LZ273145Color forState:(UIControlStateNormal)];
  32. [self.youpaipgpsBtn setTitle:@"获取定位" forState:(UIControlStateNormal)];
  33. [self.youpaipgpsBtn addTarget:self action:@selector(youpaifgpsBtnClick) forControlEvents:(UIControlEventTouchUpInside)];
  34. self.youpaipgpsBtn.uxy_acceptEventInterval = 3.0;
  35. [self.contentView addSubview:self.youpaipgpsBtn];
  36. [self.youpaipgpsBtn makeConstraints:^(MASConstraintMaker *make) {
  37. make.right.equalTo(self.right).offset(-15);
  38. make.top.equalTo(@9);
  39. make.height.equalTo(@30);
  40. }];
  41. }
  42. - (void)youpaifgpsBtnClick{
  43. if (self.youpaipblock) {
  44. self.youpaipblock();
  45. }
  46. }
  47. @end