From fc7cd399926fa1b36065c8099ceaa4707a163e1b Mon Sep 17 00:00:00 2001 From: Corentin Smith Date: Wed, 23 Aug 2017 16:33:41 +0200 Subject: [PATCH 1/2] Remove native buttons 1/2 --- ios/RSSignatureViewManager.m | 1 - 1 file changed, 1 deletion(-) diff --git a/ios/RSSignatureViewManager.m b/ios/RSSignatureViewManager.m index 1ba6cb8f..e27ad570 100644 --- a/ios/RSSignatureViewManager.m +++ b/ios/RSSignatureViewManager.m @@ -12,7 +12,6 @@ @implementation RSSignatureViewManager RCT_EXPORT_VIEW_PROPERTY(rotateClockwise, BOOL) RCT_EXPORT_VIEW_PROPERTY(square, BOOL) -RCT_EXPORT_VIEW_PROPERTY(showNativeButtons, BOOL) RCT_EXPORT_VIEW_PROPERTY(showTitleLabel, BOOL) From c6e48a557443c28b5862c7798d12ad6a30c11143 Mon Sep 17 00:00:00 2001 From: Corentin Smith Date: Wed, 23 Aug 2017 16:34:18 +0200 Subject: [PATCH 2/2] Remove native buttons 2/2 --- ios/RSSignatureView.m | 62 ------------------------------------------- 1 file changed, 62 deletions(-) diff --git a/ios/RSSignatureView.m b/ios/RSSignatureView.m index ea437347..3704dfd2 100644 --- a/ios/RSSignatureView.m +++ b/ios/RSSignatureView.m @@ -16,7 +16,6 @@ @implementation RSSignatureView { UILabel *titleLabel; BOOL _rotateClockwise; BOOL _square; - BOOL _showNativeButtons; BOOL _showTitleLabel; } @@ -25,7 +24,6 @@ @implementation RSSignatureView { - (instancetype)init { - _showNativeButtons = YES; _showTitleLabel = YES; if ((self = [super init])) { _border = [CAShapeLayer layer]; @@ -79,34 +77,6 @@ - (void)layoutSubviews //[titleLabel setBackgroundColor:[UIColor greenColor]]; [sign addSubview:titleLabel]; } - - if (_showNativeButtons) { - //Save button - saveButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - [saveButton setLineBreakMode:NSLineBreakByClipping]; - [saveButton addTarget:self action:@selector(onSaveButtonPressed) - forControlEvents:UIControlEventTouchUpInside]; - [saveButton setTitle:@"Save" forState:UIControlStateNormal]; - - CGSize buttonSize = CGSizeMake(80, 55.0); - - saveButton.frame = CGRectMake(sign.bounds.size.width - buttonSize.width, - 0, buttonSize.width, buttonSize.height); - [saveButton setBackgroundColor:[UIColor colorWithRed:250/255.f green:250/255.f blue:250/255.f alpha:1.f]]; - [sign addSubview:saveButton]; - - - //Clear button - clearButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - [clearButton setLineBreakMode:NSLineBreakByClipping]; - [clearButton addTarget:self action:@selector(onClearButtonPressed) - forControlEvents:UIControlEventTouchUpInside]; - [clearButton setTitle:@"Reset" forState:UIControlStateNormal]; - - clearButton.frame = CGRectMake(0, 0, buttonSize.width, buttonSize.height); - [clearButton setBackgroundColor:[UIColor colorWithRed:250/255.f green:250/255.f blue:250/255.f alpha:1.f]]; - [sign addSubview:clearButton]; - } } else { @@ -121,34 +91,6 @@ - (void)layoutSubviews //[titleLabel setBackgroundColor:[UIColor greenColor]]; [sign addSubview:titleLabel]; } - - if (_showNativeButtons) { - //Save button - saveButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - [saveButton setTransform:CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(90))]; - [saveButton setLineBreakMode:NSLineBreakByClipping]; - [saveButton addTarget:self action:@selector(onSaveButtonPressed) - forControlEvents:UIControlEventTouchUpInside]; - [saveButton setTitle:@"Save" forState:UIControlStateNormal]; - - CGSize buttonSize = CGSizeMake(55, 80.0); //Width/Height is swapped - - saveButton.frame = CGRectMake(sign.bounds.size.width - buttonSize.width, sign.bounds.size.height - buttonSize.height, buttonSize.width, buttonSize.height); - [saveButton setBackgroundColor:[UIColor colorWithRed:250/255.f green:250/255.f blue:250/255.f alpha:1.f]]; - [sign addSubview:saveButton]; - - //Clear button - clearButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - [clearButton setTransform:CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(90))]; - [clearButton setLineBreakMode:NSLineBreakByClipping]; - [clearButton addTarget:self action:@selector(onClearButtonPressed) - forControlEvents:UIControlEventTouchUpInside]; - [clearButton setTitle:@"Reset" forState:UIControlStateNormal]; - - clearButton.frame = CGRectMake(sign.bounds.size.width - buttonSize.width, 0, buttonSize.width, buttonSize.height); - [clearButton setBackgroundColor:[UIColor colorWithRed:250/255.f green:250/255.f blue:250/255.f alpha:1.f]]; - [sign addSubview:clearButton]; - } } } @@ -165,10 +107,6 @@ - (void)setSquare:(BOOL)square { _square = square; } -- (void)setShowNativeButtons:(BOOL)showNativeButtons { - _showNativeButtons = showNativeButtons; -} - - (void)setShowTitleLabel:(BOOL)showTitleLabel { _showTitleLabel = showTitleLabel; }