Remove shadow on IIViewDeckController 2.2.11

372 Views Asked by At

How to remove the shadow of the centerViewController on IIViewDeckController 2.2.11 ? I know I have to use a delegate that implements the viewDeckController:applyShadow:withBounds: selector. But I don't know how to do that.

If someone can help me. Thank you

2

There are 2 best solutions below

0
On BEST ANSWER

So I found the solution for the version 2.2.11.

I added this to AppDelegate.h:

#import "IIViewDeckController.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate, IIViewDeckControllerDelegate>

In AppDelegate.m, in didFinishLaunchingWithOptions class:

deckController.delegate = self;

Then I added the viewDeckController:applyShadow:withBounds: selector to the end of AppDelegate.m:

- (void)viewDeckController:(IIViewDeckController *)viewDeckController applyShadow:(CALayer *)shadowLayer withBounds:(CGRect)rect {
    shadowLayer.masksToBounds = NO;
    shadowLayer.shadowRadius = 0;
    shadowLayer.shadowOpacity = 0;
    shadowLayer.shadowColor = nil;
    shadowLayer.shadowOffset = CGSizeZero;
    shadowLayer.shadowPath = nil;
}
1
On

There is a property in the IIViewDeckController called 'shadowEnabled' simply set it to NO in your IIViewDeckController instance variable.

Alternatively in your Storyboard or .Xib file, you can add a User Defined Runtime Attribute with 'shadowEnabled' as the Key Path, 'Boolean' as the type and uncheck the value (making it NO/False)