diff --git a/Classes/PXAlertView+Customization.h b/Classes/PXAlertView+Customization.h index cbe3171..10aea97 100644 --- a/Classes/PXAlertView+Customization.h +++ b/Classes/PXAlertView+Customization.h @@ -31,6 +31,7 @@ - (void)setAllButtonsTextColor:(UIColor *)color; - (void)setOtherButtonTextColor:(UIColor *)color; +-(void)setLineLayerColor:(UIColor*)color; - (void)useDefaultIOS7Style; @end \ No newline at end of file diff --git a/Classes/PXAlertView+Customization.m b/Classes/PXAlertView+Customization.m index ee06bd1..237d5d0 100644 --- a/Classes/PXAlertView+Customization.m +++ b/Classes/PXAlertView+Customization.m @@ -38,6 +38,14 @@ - (void)useDefaultIOS7Style { [self setBackgroundColor:[UIColor whiteColor]]; } +-(void)setLineLayerColor:(UIColor*)color +{ + for (CALayer* subLayer in [self.alertView.layer sublayers]) { + if ([subLayer.name isEqualToString:@"PXAlertView_lineLayer"]) { + subLayer.backgroundColor = color.CGColor; + } + } +} - (void)setWindowTintColor:(UIColor *)color { self.backgroundView.backgroundColor = color; diff --git a/Classes/PXAlertView.m b/Classes/PXAlertView.m index 51e9ded..1f28c03 100644 --- a/Classes/PXAlertView.m +++ b/Classes/PXAlertView.m @@ -486,6 +486,7 @@ - (CALayer *)lineLayer { CALayer *lineLayer = [CALayer layer]; lineLayer.backgroundColor = [[UIColor colorWithWhite:0.90 alpha:0.3] CGColor]; + [lineLayer setName:@"PXAlertView_lineLayer"]; return lineLayer; } diff --git a/PXAlertViewDemo/PXViewController.m b/PXAlertViewDemo/PXViewController.m index 416b9ee..027bb2d 100755 --- a/PXAlertViewDemo/PXViewController.m +++ b/PXAlertViewDemo/PXViewController.m @@ -194,6 +194,7 @@ - (IBAction)showCopyOfUIAlertView:(id)sender contentView:nil completion:nil]; [alertView useDefaultIOS7Style]; + [alertView setLineLayerColor:[UIColor blackColor]]; } - (IBAction)showLargeUIAlertView:(id)sender