PDFHeaderFooterSettingView.m 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // CPDFSettingView.m
  3. // PDFViewer
  4. //
  5. // Created by kdanmobile_2 on 2022/12/13.
  6. //
  7. #import "PDFHeaderFooterSettingView.h"
  8. @implementation PDFHeaderFooterSettingView
  9. - (instancetype)initWithFrame:(CGRect)frame {
  10. self = [super initWithFrame:frame];
  11. if (self) {
  12. _settinigLabel = [[UILabel alloc] initWithFrame:self.frame];
  13. _settinigLabel.backgroundColor = [UIColor grayColor];
  14. [self addSubview:_settinigLabel];
  15. _addButton = [[UIButton alloc] init];
  16. [self addSubview:_addButton];
  17. _deleteButton = [[UIButton alloc] init];
  18. [self addSubview:_deleteButton];
  19. self.backgroundColor = [UIColor grayColor];
  20. }
  21. return self;
  22. }
  23. #pragma marl - Layout
  24. - (void)layoutSubviews {
  25. [super layoutSubviews];
  26. self.addButton.frame = CGRectMake((self.frame.size.width - 100) / 3, 25, 50, 50);
  27. self.deleteButton.frame = CGRectMake((self.frame.size.width - 100) / 3 * 2 + 50, 25, 50, 50);
  28. }
  29. - (void)setText {
  30. [_addButton setImage:[UIImage imageNamed:@"add_newpage01"] forState:UIControlStateNormal];
  31. [_addButton setTitle:NSLocalizedString(@"Add", nil)forState:UIControlStateNormal];
  32. _addButton.imageEdgeInsets = UIEdgeInsetsMake(0, 18, 24, 10);
  33. _addButton.titleEdgeInsets = UIEdgeInsetsMake(self.addButton.imageView.frame.size.height, -self.addButton.imageView.frame.size.width, -1,-11);
  34. [_deleteButton setImage:[UIImage imageNamed:@"pageedit_delete"] forState:UIControlStateNormal];
  35. [_deleteButton setTitle:NSLocalizedString(@"Delete", nil) forState:UIControlStateNormal];
  36. _deleteButton.imageEdgeInsets = UIEdgeInsetsMake(0, 18, 24, 10);
  37. _deleteButton.titleEdgeInsets = UIEdgeInsetsMake(self.deleteButton.imageView.frame.size.height, -self.deleteButton.imageView.frame.size.width, -1,-11);
  38. }
  39. @end