NIMCustomLeftBarView.m 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // NIMCustomLeftBarView.m
  3. // NIMKit
  4. //
  5. // Created by chris.
  6. // Copyright (c) 2014年 Netease. All rights reserved.
  7. //
  8. #import "NIMCustomLeftBarView.h"
  9. #import "NIMBadgeView.h"
  10. #import "UIView+NIM.h"
  11. @implementation NIMCustomLeftBarView
  12. - (id)initWithFrame:(CGRect)frame
  13. {
  14. self = [super initWithFrame:frame];
  15. if (self) {
  16. // Initialization code
  17. [self initSubviews];
  18. self.userInteractionEnabled = YES;
  19. }
  20. return self;
  21. }
  22. - (void)initSubviews
  23. {
  24. self.backImgV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 24, 34)];
  25. self.backImgV.image = [UIImage imageNamed:@"vqu_images_navigation_back_black"];
  26. self.backImgV.contentMode = UIViewContentModeScaleAspectFill;
  27. [self addSubview:self.backImgV];
  28. self.badgeView = [NIMBadgeView viewWithBadgeTip:@""];
  29. self.badgeView.frame = CGRectMake(24, 8, 0, 0);
  30. self.badgeView.hidden = YES;
  31. self.badgeView.badgeBackgroundColor = [UIColor whiteColor];
  32. self.badgeView.CirclegroundColor = [UIColor whiteColor];
  33. self.badgeView.badgeTextColor = LZ273145Color;
  34. self.badgeView.badgeTextFont = LCFont14;
  35. self.frame = CGRectMake(0.0, 0.0, 70.0, 44.f);
  36. [self addSubview:self.badgeView];
  37. }
  38. - (void)layoutSubviews{
  39. [super layoutSubviews];
  40. for (UIView *view in self.subviews) {
  41. view.nim_centerY = self.nim_height * .5f;
  42. }
  43. }
  44. @end