|
@@ -13,153 +13,154 @@
|
|
|
- (instancetype)initWithFrame:(CGRect)frame {
|
|
|
self = [super initWithFrame:frame];
|
|
|
if (self) {
|
|
|
- _opacitySlider = [[UISlider alloc] init];
|
|
|
- _scaleSlider = [[UISlider alloc] init];
|
|
|
- _rotationSlider = [[UISlider alloc] init];
|
|
|
-
|
|
|
- [self addSubview:_opacitySlider];
|
|
|
- [self addSubview:_scaleSlider];
|
|
|
- [self addSubview:_rotationSlider];
|
|
|
-
|
|
|
- _rotationlabel = [[UILabel alloc] init];
|
|
|
- _rangeLabel = [[UILabel alloc] init];
|
|
|
- _textLabel = [[UILabel alloc] init];
|
|
|
- _opacityLabel = [[UILabel alloc] init];
|
|
|
- _titleLabel = [[UILabel alloc] init];
|
|
|
-
|
|
|
- [self addSubview:_textLabel];
|
|
|
- [self addSubview:_opacityLabel];
|
|
|
- [self addSubview:_rangeLabel];
|
|
|
- [self addSubview:_rotationlabel];
|
|
|
- [self addSubview:_titleLabel];
|
|
|
-
|
|
|
- _verticalField = [[UITextField alloc] init];
|
|
|
- _verticalField.borderStyle = UITextBorderStyleRoundedRect;
|
|
|
- _verticalLabel = [[UILabel alloc] init];
|
|
|
- _horizontalField = [[UITextField alloc] init];
|
|
|
- _horizontalField.borderStyle = UITextBorderStyleRoundedRect;
|
|
|
- _horizontalLabel = [[UILabel alloc] init];
|
|
|
- _pageBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
|
|
|
-
|
|
|
- [self addSubview:_verticalLabel];
|
|
|
- [self addSubview:_verticalField];
|
|
|
- [self addSubview:_horizontalField];
|
|
|
- [self addSubview:_horizontalLabel];
|
|
|
- [self addSubview:_pageBtn];
|
|
|
-
|
|
|
- _doneBtn = [[UIButton alloc] init];
|
|
|
- _cancelBtn = [[UIButton alloc] init];
|
|
|
-
|
|
|
- [self addSubview:_doneBtn];
|
|
|
- [self addSubview:_cancelBtn];
|
|
|
-
|
|
|
- self.backgroundColor = [UIColor grayColor];
|
|
|
+// _opacitySlider = [[UISlider alloc] init];
|
|
|
+// _scaleSlider = [[UISlider alloc] init];
|
|
|
+// _rotationSlider = [[UISlider alloc] init];
|
|
|
+//
|
|
|
+// [self addSubview:_opacitySlider];
|
|
|
+// [self addSubview:_scaleSlider];
|
|
|
+// [self addSubview:_rotationSlider];
|
|
|
+//
|
|
|
+// _rotationlabel = [[UILabel alloc] init];
|
|
|
+// _rangeLabel = [[UILabel alloc] init];
|
|
|
+// _textLabel = [[UILabel alloc] init];
|
|
|
+// _opacityLabel = [[UILabel alloc] init];
|
|
|
+// _titleLabel = [[UILabel alloc] init];
|
|
|
+//
|
|
|
+// [self addSubview:_textLabel];
|
|
|
+// [self addSubview:_opacityLabel];
|
|
|
+// [self addSubview:_rangeLabel];
|
|
|
+// [self addSubview:_rotationlabel];
|
|
|
+// [self addSubview:_titleLabel];
|
|
|
+//
|
|
|
+// _verticalField = [[UITextField alloc] init];
|
|
|
+// _verticalField.borderStyle = UITextBorderStyleRoundedRect;
|
|
|
+// _verticalLabel = [[UILabel alloc] init];
|
|
|
+// _horizontalField = [[UITextField alloc] init];
|
|
|
+// _horizontalField.borderStyle = UITextBorderStyleRoundedRect;
|
|
|
+// _horizontalLabel = [[UILabel alloc] init];
|
|
|
+// _pageBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
|
|
|
+//
|
|
|
+// [self addSubview:_verticalLabel];
|
|
|
+// [self addSubview:_verticalField];
|
|
|
+// [self addSubview:_horizontalField];
|
|
|
+// [self addSubview:_horizontalLabel];
|
|
|
+// [self addSubview:_pageBtn];
|
|
|
+//
|
|
|
+// _doneBtn = [[UIButton alloc] init];
|
|
|
+// _cancelBtn = [[UIButton alloc] init];
|
|
|
+//
|
|
|
+// [self addSubview:_doneBtn];
|
|
|
+// [self addSubview:_cancelBtn];
|
|
|
+//
|
|
|
+// self.backgroundColor = [UIColor grayColor];
|
|
|
+ self = [[NSBundle mainBundle] loadNibNamed:@"BackgroundSettingView" owner:nil options:nil].firstObject;
|
|
|
}
|
|
|
|
|
|
return self;
|
|
|
}
|
|
|
|
|
|
-- (void)drawRect:(CGRect)rect {
|
|
|
-
|
|
|
- _titleLabel.frame = CGRectMake(5, 5, 180, 50);
|
|
|
- _rangeLabel.frame = CGRectMake(5, 165, 150, 30);
|
|
|
- _textLabel.frame = CGRectMake(5, 95, 90, 30);
|
|
|
- _opacityLabel.frame = CGRectMake(5, 60, 90, 30);
|
|
|
- _rotationlabel.frame = CGRectMake(5, 130, 90, 30);
|
|
|
-
|
|
|
- [self addConstraint];
|
|
|
- [self assignData];
|
|
|
-}
|
|
|
+//- (void)drawRect:(CGRect)rect {
|
|
|
+//
|
|
|
+// _titleLabel.frame = CGRectMake(5, 5, 180, 50);
|
|
|
+// _rangeLabel.frame = CGRectMake(5, 165, 150, 30);
|
|
|
+// _textLabel.frame = CGRectMake(5, 95, 90, 30);
|
|
|
+// _opacityLabel.frame = CGRectMake(5, 60, 90, 30);
|
|
|
+// _rotationlabel.frame = CGRectMake(5, 130, 90, 30);
|
|
|
+//
|
|
|
+// [self addConstraint];
|
|
|
+// [self assignData];
|
|
|
+//}
|
|
|
|
|
|
-- (void)addConstraint {
|
|
|
- [_verticalField mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.right.equalTo(self.mas_right).offset(-15);
|
|
|
- make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
|
|
|
- make.width.equalTo(@80);
|
|
|
- make.height.equalTo(@30);
|
|
|
- }];
|
|
|
- [_verticalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.right.equalTo(self.mas_right).offset(-95);
|
|
|
- make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
|
|
|
- make.width.equalTo(@20);
|
|
|
- make.height.equalTo(@30);
|
|
|
- }];
|
|
|
- [_horizontalField mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.left.equalTo(self.mas_left).offset(25);
|
|
|
- make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
|
|
|
- make.width.equalTo(@80);
|
|
|
- make.height.equalTo(@30);
|
|
|
- }];
|
|
|
- [_horizontalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.left.equalTo(self.mas_left).offset(5);
|
|
|
- make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
|
|
|
- make.width.equalTo(@20);
|
|
|
- make.height.equalTo(@30);
|
|
|
- }];
|
|
|
- [_scaleSlider mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.right.equalTo(self.mas_right).offset(-15);
|
|
|
- make.left.equalTo(_textLabel.mas_right).offset(0);
|
|
|
- make.top.equalTo(self.mas_top).offset(95);
|
|
|
- make.height.equalTo(@30);
|
|
|
- }];
|
|
|
- [_opacitySlider mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.right.equalTo(self.mas_right).offset(-15);
|
|
|
- make.left.equalTo(_opacityLabel.mas_right).offset(0);
|
|
|
- make.top.equalTo(self.mas_top).offset(60);
|
|
|
- make.height.equalTo(@30);
|
|
|
- }];
|
|
|
- [_rotationSlider mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.right.equalTo(self.mas_right).offset(-15);
|
|
|
- make.left.equalTo(_rotationlabel.mas_right).offset(0);
|
|
|
- make.top.equalTo(_scaleSlider.mas_bottom).offset(5);
|
|
|
- }];
|
|
|
-
|
|
|
- [_pageBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.right.equalTo(self.mas_right).offset(-15);
|
|
|
- make.top.equalTo(self.rotationSlider.mas_bottom).offset(5);
|
|
|
- make.left.equalTo(_rangeLabel.mas_right);
|
|
|
- make.height.equalTo(@35);
|
|
|
- }];
|
|
|
-
|
|
|
- [_doneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.right.equalTo(self.mas_right).offset(-15);
|
|
|
- make.top.equalTo(_horizontalField.mas_bottom).offset(25);
|
|
|
- make.height.mas_equalTo(30);
|
|
|
- make.width.mas_equalTo(80);
|
|
|
- }];
|
|
|
-
|
|
|
- [_cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.right.equalTo(self.mas_right).offset(-110);
|
|
|
- make.top.equalTo(_horizontalField.mas_bottom).offset(25);
|
|
|
- make.height.mas_equalTo(30);
|
|
|
- make.width.mas_equalTo(80);
|
|
|
- }];
|
|
|
-}
|
|
|
+//- (void)addConstraint {
|
|
|
+// [_verticalField mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.right.equalTo(self.mas_right).offset(-15);
|
|
|
+// make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
|
|
|
+// make.width.equalTo(@80);
|
|
|
+// make.height.equalTo(@30);
|
|
|
+// }];
|
|
|
+// [_verticalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.right.equalTo(self.mas_right).offset(-95);
|
|
|
+// make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
|
|
|
+// make.width.equalTo(@20);
|
|
|
+// make.height.equalTo(@30);
|
|
|
+// }];
|
|
|
+// [_horizontalField mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.left.equalTo(self.mas_left).offset(25);
|
|
|
+// make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
|
|
|
+// make.width.equalTo(@80);
|
|
|
+// make.height.equalTo(@30);
|
|
|
+// }];
|
|
|
+// [_horizontalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.left.equalTo(self.mas_left).offset(5);
|
|
|
+// make.top.equalTo(self.pageBtn.mas_bottom).offset(10);
|
|
|
+// make.width.equalTo(@20);
|
|
|
+// make.height.equalTo(@30);
|
|
|
+// }];
|
|
|
+// [_scaleSlider mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.right.equalTo(self.mas_right).offset(-15);
|
|
|
+// make.left.equalTo(_textLabel.mas_right).offset(0);
|
|
|
+// make.top.equalTo(self.mas_top).offset(95);
|
|
|
+// make.height.equalTo(@30);
|
|
|
+// }];
|
|
|
+// [_opacitySlider mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.right.equalTo(self.mas_right).offset(-15);
|
|
|
+// make.left.equalTo(_opacityLabel.mas_right).offset(0);
|
|
|
+// make.top.equalTo(self.mas_top).offset(60);
|
|
|
+// make.height.equalTo(@30);
|
|
|
+// }];
|
|
|
+// [_rotationSlider mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.right.equalTo(self.mas_right).offset(-15);
|
|
|
+// make.left.equalTo(_rotationlabel.mas_right).offset(0);
|
|
|
+// make.top.equalTo(_scaleSlider.mas_bottom).offset(5);
|
|
|
+// }];
|
|
|
+//
|
|
|
+// [_pageBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.right.equalTo(self.mas_right).offset(-15);
|
|
|
+// make.top.equalTo(self.rotationSlider.mas_bottom).offset(5);
|
|
|
+// make.left.equalTo(_rangeLabel.mas_right);
|
|
|
+// make.height.equalTo(@35);
|
|
|
+// }];
|
|
|
+//
|
|
|
+// [_doneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.right.equalTo(self.mas_right).offset(-15);
|
|
|
+// make.top.equalTo(_horizontalField.mas_bottom).offset(25);
|
|
|
+// make.height.mas_equalTo(30);
|
|
|
+// make.width.mas_equalTo(80);
|
|
|
+// }];
|
|
|
+//
|
|
|
+// [_cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.right.equalTo(self.mas_right).offset(-110);
|
|
|
+// make.top.equalTo(_horizontalField.mas_bottom).offset(25);
|
|
|
+// make.height.mas_equalTo(30);
|
|
|
+// make.width.mas_equalTo(80);
|
|
|
+// }];
|
|
|
+//}
|
|
|
|
|
|
-- (void)assignData {
|
|
|
- _rangeLabel.text = NSLocalizedString(@"Page Range", nil);
|
|
|
- _rangeLabel.font = [UIFont systemFontOfSize:15];
|
|
|
- _titleLabel.text = NSLocalizedString(@"Background Edit", nil);
|
|
|
- _rotationlabel.text = NSLocalizedString(@"Rotation", nil);
|
|
|
- _textLabel.text = NSLocalizedString(@"Scale", nil);
|
|
|
- _opacityLabel.text = NSLocalizedString(@"Opacity", nil);
|
|
|
- _verticalLabel.text = @"Y:";
|
|
|
- _horizontalLabel.text = @"X:";
|
|
|
- _verticalField.text = NSLocalizedString(@"100", nil);
|
|
|
- _horizontalField.text = NSLocalizedString(@"100", nil);
|
|
|
-
|
|
|
- _scaleSlider.minimumValue = 0.2;
|
|
|
- _scaleSlider.maximumValue = 1;
|
|
|
- _scaleSlider.value = 1;
|
|
|
-
|
|
|
- _rotationSlider.minimumValue = 0;
|
|
|
- _rotationSlider.maximumValue = M_PI;
|
|
|
-
|
|
|
- [_pageBtn setTitle:NSLocalizedString(@"Page Range", nil) forState:UIControlStateNormal];
|
|
|
- [_doneBtn setTitle:NSLocalizedString(@"Done", nil) forState:UIControlStateNormal];
|
|
|
- [_doneBtn setTitleColor:UIColor.systemBlueColor forState:UIControlStateNormal];
|
|
|
- [_cancelBtn setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal];
|
|
|
- [_cancelBtn setTitleColor:UIColor.systemBlueColor forState:UIControlStateNormal];
|
|
|
-}
|
|
|
+//- (void)assignData {
|
|
|
+// _rangeLabel.text = NSLocalizedString(@"Page Range", nil);
|
|
|
+// _rangeLabel.font = [UIFont systemFontOfSize:15];
|
|
|
+// _titleLabel.text = NSLocalizedString(@"Background Edit", nil);
|
|
|
+// _rotationlabel.text = NSLocalizedString(@"Rotation", nil);
|
|
|
+// _textLabel.text = NSLocalizedString(@"Scale", nil);
|
|
|
+// _opacityLabel.text = NSLocalizedString(@"Opacity", nil);
|
|
|
+// _verticalLabel.text = @"Y:";
|
|
|
+// _horizontalLabel.text = @"X:";
|
|
|
+// _verticalField.text = NSLocalizedString(@"100", nil);
|
|
|
+// _horizontalField.text = NSLocalizedString(@"100", nil);
|
|
|
+//
|
|
|
+// _scaleSlider.minimumValue = 0.2;
|
|
|
+// _scaleSlider.maximumValue = 1;
|
|
|
+// _scaleSlider.value = 1;
|
|
|
+//
|
|
|
+// _rotationSlider.minimumValue = 0;
|
|
|
+// _rotationSlider.maximumValue = M_PI;
|
|
|
+//
|
|
|
+// [_pageBtn setTitle:NSLocalizedString(@"Page Range", nil) forState:UIControlStateNormal];
|
|
|
+// [_doneBtn setTitle:NSLocalizedString(@"Done", nil) forState:UIControlStateNormal];
|
|
|
+// [_doneBtn setTitleColor:UIColor.systemBlueColor forState:UIControlStateNormal];
|
|
|
+// [_cancelBtn setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal];
|
|
|
+// [_cancelBtn setTitleColor:UIColor.systemBlueColor forState:UIControlStateNormal];
|
|
|
+//}
|
|
|
|
|
|
@end
|