- Added option to enable/disable shadow
This commit is contained in:
parent
38f6bb528c
commit
fd9a508323
|
|
@ -44,6 +44,7 @@ typedef enum{
|
|||
|
||||
@property (nonatomic, assign) BOOL avoidSwitchingToSameClassViewController;
|
||||
@property (nonatomic, assign) BOOL enableSwipeGesture;
|
||||
@property (nonatomic, assign) BOOL enableShadow;
|
||||
@property (nonatomic, strong) UIViewController *rightMenu;
|
||||
@property (nonatomic, strong) UIViewController *leftMenu;
|
||||
@property (nonatomic, strong) UIBarButtonItem *leftBarButtonItem;
|
||||
|
|
|
|||
|
|
@ -97,23 +97,17 @@ static SlideNavigationController *singletonInstance;
|
|||
self.avoidSwitchingToSameClassViewController = YES;
|
||||
singletonInstance = self;
|
||||
self.delegate = self;
|
||||
|
||||
self.view.layer.shadowColor = [UIColor darkGrayColor].CGColor;
|
||||
self.view.layer.shadowRadius = MENU_SHADOW_RADIUS;
|
||||
self.view.layer.shadowOpacity = MENU_SHADOW_OPACITY;
|
||||
self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath;
|
||||
self.view.layer.shouldRasterize = YES;
|
||||
self.view.layer.rasterizationScale = [UIScreen mainScreen].scale;
|
||||
|
||||
[self setEnableSwipeGesture:YES];
|
||||
self.enableShadow = YES;
|
||||
self.enableSwipeGesture = YES;
|
||||
}
|
||||
|
||||
- (void)viewWillLayoutSubviews
|
||||
{
|
||||
[super viewWillLayoutSubviews];
|
||||
|
||||
// Update shadow size
|
||||
self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath;
|
||||
// Update shadow size of enabled
|
||||
if (self.enableShadow)
|
||||
self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath;
|
||||
}
|
||||
|
||||
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
|
||||
|
|
@ -292,6 +286,24 @@ static SlideNavigationController *singletonInstance;
|
|||
return (self.horizontalLocation == 0) ? NO : YES;
|
||||
}
|
||||
|
||||
- (void)setEnableShaddow:(BOOL)enable
|
||||
{
|
||||
if (enable)
|
||||
{
|
||||
self.view.layer.shadowColor = [UIColor darkGrayColor].CGColor;
|
||||
self.view.layer.shadowRadius = MENU_SHADOW_RADIUS;
|
||||
self.view.layer.shadowOpacity = MENU_SHADOW_OPACITY;
|
||||
self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath;
|
||||
self.view.layer.shouldRasterize = YES;
|
||||
self.view.layer.rasterizationScale = [UIScreen mainScreen].scale;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.view.layer.shadowOpacity = 0;
|
||||
self.view.layer.shadowRadius = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Override Methods -
|
||||
|
||||
- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated
|
||||
|
|
|
|||
Loading…
Reference in New Issue