MyTDGroupView.m 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // MyTDGroupView.m
  3. // smartRhino
  4. //
  5. // Created by tederen on 2019/10/31.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import "MyTDGroupView.h"
  9. @interface MyTDGroupView()
  10. @end
  11. @implementation MyTDGroupView
  12. - (instancetype)init
  13. {
  14. self = [super init];
  15. if (self) {
  16. self.backgroundColor = [UIColor whiteColor];
  17. [self addSubview:self.button];
  18. self.button.frame = CGRectMake(15,10,kGXScreenWidth - 30,30);
  19. [self.button setBackgroundColor:UIColorHex(F5F6F8)];
  20. [self.button setTitleColor:UIColorHex(ABACAE) forState:UIControlStateNormal];
  21. self.button.layer.cornerRadius = 15;
  22. self.button.layer.borderWidth = 0.f;
  23. self.button.layer.masksToBounds = YES;
  24. }
  25. return self;
  26. }
  27. - (instancetype)initWithFrame:(CGRect)frame
  28. {
  29. self = [super initWithFrame:frame];
  30. if (self) {
  31. self.backgroundColor = [UIColor whiteColor];
  32. [self addSubview:self.button];
  33. self.button.frame = CGRectMake(15,0,frame.size.width - 30,frame.size.height);
  34. [self.button setBackgroundColor:UIColorHex(0xffffff)];
  35. [self.button setTitleColor:UIColorHex(0x999999) forState:UIControlStateNormal];
  36. self.button.layer.borderWidth = 0.5f;
  37. self.button.layer.borderColor = UIColorHex(0xDADADA).CGColor;
  38. self.button.layer.cornerRadius = frame.size.height * 0.5;
  39. self.button.layer.masksToBounds = YES;
  40. }
  41. return self;
  42. }
  43. - (TDButton *)button{
  44. if (!_button) {
  45. _button = [[TDButton alloc] init];
  46. [_button setTitle:@" 搜索" forState:UIControlStateNormal];
  47. [[_button titleLabel] setFont:[UIFont fontWithName:@"PingFang-SC-Regular" size:13.f]];
  48. [_button setImage:IMG(@"chatmsg_search_icon") forState:UIControlStateNormal];
  49. }
  50. return _button;
  51. }
  52. @end