diff --git a/PinPadExample/PinPad/PPCircleButton.m b/PinPadExample/PinPad/PPCircleButton.m index daa96d4..9c8ea07 100644 --- a/PinPadExample/PinPad/PPCircleButton.m +++ b/PinPadExample/PinPad/PPCircleButton.m @@ -20,6 +20,10 @@ - (id)initWithFrame:(CGRect)frame } +-(void) willMoveToSuperview:(UIView *)newSuperview{ + self.layer.borderColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5].CGColor; +} + // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. @@ -28,18 +32,22 @@ - (void)drawRect:(CGRect)rect // Drawing code [super drawRect:rect]; [self.layer setCornerRadius:CGRectGetHeight(rect)/2.0]; - self.layer.borderColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5].CGColor; - self.layer.borderWidth = 2.0f; + self.layer.borderWidth = 1.7f; + self.layer.masksToBounds = YES; } - (void)setHighlighted:(BOOL)highlighted { if(highlighted) { - self.layer.borderColor = [self titleColorForState:UIControlStateHighlighted].CGColor; + self.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5]; + self.layer.borderColor = [UIColor clearColor].CGColor; } else { + self.backgroundColor = [UIColor clearColor]; self.layer.borderColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5].CGColor; } } + + @end diff --git a/PinPadExample/PinPad/PPPinPadViewController.h b/PinPadExample/PinPad/PPPinPadViewController.h index 56063b3..43cbe06 100644 --- a/PinPadExample/PinPad/PPPinPadViewController.h +++ b/PinPadExample/PinPad/PPPinPadViewController.h @@ -29,6 +29,8 @@ __weak IBOutlet UIImageView *backgroundImageView; __weak IBOutlet UIButton *resetButton; __weak IBOutlet UIButton *cancelButton; + __weak IBOutlet UIView *_pinContainer; + __weak IBOutlet UIView *_numPadContainer; NSMutableString *_inputPin; NSMutableArray *_circleViewList; } diff --git a/PinPadExample/PinPad/PPPinPadViewController.m b/PinPadExample/PinPad/PPPinPadViewController.m index fe8f174..7df4288 100644 --- a/PinPadExample/PinPad/PPPinPadViewController.m +++ b/PinPadExample/PinPad/PPPinPadViewController.m @@ -11,6 +11,8 @@ #define PP_SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) +#define PP_IS_IPHONE ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) +#define PP_IS_IPHONE_5 (PP_IS_IPHONE && ([[UIScreen mainScreen] bounds].size.height > 480.0)) typedef NS_ENUM(NSInteger, settingNewPinState) { @@ -56,6 +58,18 @@ - (void)viewDidLoad self.view.backgroundColor = self.backgroundColor; } + if (!PP_SYSTEM_VERSION_GREATER_THAN(@"6.9")) { + CGRect frame = _pinContainer.frame; + frame.origin.y += 20; + _pinContainer.frame = frame; + } + + if (!PP_IS_IPHONE_5) { + CGRect frame = _numPadContainer.frame; + frame.size.height -= 50; + _numPadContainer.frame = frame; + } + } diff --git a/PinPadExample/PinPad/PPPinPadViewController.xib b/PinPadExample/PinPad/PPPinPadViewController.xib index 5fad805..115c0c2 100644 --- a/PinPadExample/PinPad/PPPinPadViewController.xib +++ b/PinPadExample/PinPad/PPPinPadViewController.xib @@ -1,14 +1,16 @@ - + - + + + @@ -26,183 +28,183 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - + - - - + @@ -212,4 +214,4 @@ - \ No newline at end of file +