12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- //
- // CPDFSettingView.m
- // PDFViewer
- //
- // Created by kdanmobile_2 on 2022/12/13.
- //
- #import "PDFHeaderFooterSettingView.h"
- @implementation PDFHeaderFooterSettingView
- - (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- _settinigLabel = [[UILabel alloc] initWithFrame:self.frame];
- _settinigLabel.backgroundColor = [UIColor grayColor];
- [self addSubview:_settinigLabel];
-
- _addButton = [[UIButton alloc] init];
- [self addSubview:_addButton];
-
- _deleteButton = [[UIButton alloc] init];
- [self addSubview:_deleteButton];
-
- self.backgroundColor = [UIColor grayColor];
- }
- return self;
- }
- #pragma marl - Layout
- - (void)layoutSubviews {
- [super layoutSubviews];
-
- self.addButton.frame = CGRectMake((self.frame.size.width - 100) / 3, 25, 50, 50);
-
- self.deleteButton.frame = CGRectMake((self.frame.size.width - 100) / 3 * 2 + 50, 25, 50, 50);
- }
- - (void)setText {
- [_addButton setImage:[UIImage imageNamed:@"add_newpage01"] forState:UIControlStateNormal];
- [_addButton setTitle:NSLocalizedString(@"Add", nil)forState:UIControlStateNormal];
- _addButton.imageEdgeInsets = UIEdgeInsetsMake(0, 18, 24, 10);
- _addButton.titleEdgeInsets = UIEdgeInsetsMake(self.addButton.imageView.frame.size.height, -self.addButton.imageView.frame.size.width, -1,-11);
-
- [_deleteButton setImage:[UIImage imageNamed:@"pageedit_delete"] forState:UIControlStateNormal];
- [_deleteButton setTitle:NSLocalizedString(@"Delete", nil) forState:UIControlStateNormal];
- _deleteButton.imageEdgeInsets = UIEdgeInsetsMake(0, 18, 24, 10);
- _deleteButton.titleEdgeInsets = UIEdgeInsetsMake(self.deleteButton.imageView.frame.size.height, -self.deleteButton.imageView.frame.size.width, -1,-11);
- }
- @end
|