QMFileTabbarView.m 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // QMFileTabbarView.m
  3. // IMSDK-OC
  4. //
  5. // Created by HCF on 16/8/15.
  6. // Copyright © 2016年 HCF. All rights reserved.
  7. //
  8. #import "QMFileTabbarView.h"
  9. @implementation QMFileTabbarView
  10. - (instancetype)initWithFrame:(CGRect)frame {
  11. self = [super initWithFrame:frame];
  12. if (self) {
  13. [self createUI];
  14. }
  15. return self;
  16. }
  17. - (void)createUI {
  18. self.backgroundColor = [UIColor whiteColor];
  19. self.layer.borderColor = [[UIColor lightGrayColor] CGColor];
  20. self.layer.borderWidth = 0.5;
  21. self.doneButton = [[UIButton alloc] init];
  22. self.doneButton.frame = CGRectMake(kScreenWidth-80, 7, 70, 30);
  23. [self.doneButton setTitle:NSLocalizedString(@"button.complete", nil) forState:UIControlStateNormal];
  24. self.doneButton.layer.cornerRadius = 5;
  25. self.doneButton.layer.masksToBounds = YES;
  26. [self.doneButton setBackgroundImage:[[UIImage imageNamed:@"send_press_no_allow"] stretchableImageWithLeftCapWidth:10 topCapHeight:10] forState:UIControlStateNormal];
  27. [self.doneButton setBackgroundImage:[[UIImage imageNamed:@"send_press_allow"] stretchableImageWithLeftCapWidth:10 topCapHeight:10] forState:UIControlStateSelected];
  28. [self.doneButton addTarget:self action:@selector(doneAction) forControlEvents:UIControlEventTouchUpInside];
  29. [self addSubview:self.doneButton];
  30. }
  31. - (void)doneAction {
  32. self.selectAction();
  33. }
  34. @end