|
@@ -56,21 +56,15 @@
|
|
|
}
|
|
|
|
|
|
- (void)setUp {
|
|
|
-
|
|
|
- self.textEditButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
- [self.textEditButton sizeToFit];
|
|
|
+ self.textEditButton = [[UIButton alloc] initWithFrame:CGRectMake(10, 7, 30, 30)];
|
|
|
[self.textEditButton addTarget:self action:@selector(textEditAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
- self.textEditButton.frame = CGRectMake(10, 7, self.textEditButton.frame.size.width + 10, 30);
|
|
|
[self.textEditButton setImage:[UIImage imageNamed:@"CPDFEditAddText" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
|
|
|
|
|
|
-
|
|
|
- self.imageEditButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
- [self.imageEditButton sizeToFit];
|
|
|
- [self.imageEditButton addTarget:self action:@selector(imageEditAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
- self.imageEditButton.frame = CGRectMake(CGRectGetMaxX(self.textEditButton.frame) + 10, 7, self.imageEditButton.frame.size.width + 10, 30);
|
|
|
+ self.imageEditButton = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.textEditButton.frame) + 10, 7, 30, 30)];
|
|
|
+ [self.imageEditButton addTarget:self action:@selector(imageEditAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
[self.imageEditButton setImage:[UIImage imageNamed:@"CPDFEditAddImage" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
|
|
|
|
|
|
- self.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0,self.bounds.size.width - 160, 44)];
|
|
|
+ self.leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0,self.bounds.size.width - 110, 44)];
|
|
|
[self addSubview:self.leftView];
|
|
|
[self.leftView addSubview:self.textEditButton];
|
|
|
[self.leftView addSubview:self.imageEditButton];
|
|
@@ -79,28 +73,36 @@
|
|
|
self.textEditButton.frame = CGRectMake(CGRectGetMidX(self.leftView.frame) - 50, self.textEditButton.frame.origin.y, self.textEditButton.frame.size.width, self.textEditButton.frame.size.height);
|
|
|
self.imageEditButton.frame = CGRectMake(CGRectGetMidX(self.leftView.frame) + 20, self.imageEditButton.frame.origin.y, self.imageEditButton.frame.size.width, self.imageEditButton.frame.size.height);
|
|
|
|
|
|
- self.propertyButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
- [self.propertyButton setBackgroundImage:[UIImage imageNamed:@"CPDFEditUnorderedList" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
|
|
|
- self.propertyButton.frame = CGRectMake(20, 12, 20, 20);
|
|
|
+ UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(19, 12, 1, 20)];
|
|
|
+ if (@available(iOS 13.0, *)){
|
|
|
+ if([UITraitCollection currentTraitCollection].userInterfaceStyle == UIUserInterfaceStyleDark)
|
|
|
+ lineView.backgroundColor = [UIColor whiteColor];
|
|
|
+ else
|
|
|
+ lineView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.1];
|
|
|
+ } else
|
|
|
+ lineView.backgroundColor = [UIColor blackColor];
|
|
|
+
|
|
|
+ self.propertyButton = [[UIButton alloc] initWithFrame:CGRectMake(20, 7, 30, 30)];
|
|
|
+ [self.propertyButton setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageProperties" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
|
|
|
+ self.propertyButton.frame = CGRectMake(20, 7, 30, 30);
|
|
|
[self.propertyButton addTarget:self action:@selector(propertyAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
|
- self.undoButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
- self.undoButton.frame = CGRectMake(CGRectGetMaxX(self.propertyButton.frame) + 25, 12, 20, 20);
|
|
|
+ self.undoButton = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.propertyButton.frame), 7, 30, 30)];
|
|
|
[self.undoButton addTarget:self action:@selector(undoAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
- [self.undoButton setBackgroundImage:[UIImage imageNamed:@"CPDFEditUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
|
|
|
+ [self.undoButton setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageUndo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
|
|
|
|
|
|
- self.redoButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
- self.redoButton.frame = CGRectMake(CGRectGetMaxX(self.undoButton.frame) + 25, 12,20, 20);
|
|
|
+ self.redoButton = [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.undoButton.frame), 7,30, 30)];
|
|
|
[self.redoButton addTarget:self action:@selector(redoAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
- [self.redoButton setBackgroundImage:[UIImage imageNamed:@"CPDFEditRedo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
|
|
|
+ [self.redoButton setImage:[UIImage imageNamed:@"CPDFAnnotationBarImageRedo" inBundle:[NSBundle bundleForClass:self.class] compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
|
|
|
|
|
|
- self.rightView = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.leftView.frame), 0, 160, 60)];
|
|
|
+ self.rightView = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.leftView.frame), 0, 110, 44)];
|
|
|
[self addSubview:self.self.rightView];
|
|
|
|
|
|
[self.rightView addSubview:self.redoButton];
|
|
|
[self.rightView addSubview:self.undoButton];
|
|
|
[self.rightView addSubview:self.propertyButton];
|
|
|
-
|
|
|
+ [self.rightView addSubview:lineView];
|
|
|
+
|
|
|
self.backgroundColor = [UIColor colorWithRed:0.98 green:0.99 blue:1.0 alpha:1.0];
|
|
|
|
|
|
self.splitView = [[UIView alloc] initWithFrame:CGRectMake(self.leftView.bounds.size.width-1, 12, 1, 20)];
|