123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //
- // CPDFHeadView.m
- // PDFViewer
- //
- // Created by kdanmobile_2 on 2022/12/7.
- //
- #import "PDFHeadView.h"
- @implementation PDFHeadView
- - (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
-
- self.preLabel = [[UILabel alloc] init];
- [self.preLabel setText:@"1"];
- self.preLabel.font = [UIFont systemFontOfSize:6];
- [self.documentView addSubview:self.preLabel];
- }
- return self;
- }
- - (void)drawRect:(CGRect)rect {
- [super drawRect:rect];
-
- [self.documentView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(self.mas_top);
- make.left.equalTo(self.mas_left);
- make.width.mas_equalTo(self.image.size.width / 9);
- make.height.mas_equalTo(self.image.size.height / 9);
- }];
-
- [self.preLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(self.documentView.mas_top).offset(0.5);
- make.left.equalTo(self.documentView.mas_left).offset(0.5);
- make.height.mas_equalTo(10);
- make.width.mas_equalTo(20);
- }];
- }
- @end
|