2014-09-22 32 views
0

如何在IIViewDeckController 2.2.11上刪除centerViewController的陰影?我知道我必須使用實現viewDeckController的代理:applyShadow:withBounds:selector。但我不知道該怎麼做。在IIViewDeckController上刪除陰影2.2.11

如果有人可以幫助我。謝謝

回答

0

所以我找到了2.2.11版的解決方案。

我將此添加到AppDelegate.h:

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

在AppDelegate.m,在didFinishLaunchingWithOptions類:

deckController.delegate = self; 

然後我加入viewDeckController:applyShadow:withBounds:選擇器的端部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; 
} 
2

有一個在IIViewDeckController的屬性稱爲「shadowEnabled」簡單地將它設置爲NO在IIViewDeckController實例變量。

或者在你的故事板或文件的.xib,你可以添加一個用戶自定義運行屬性與「shadowEnabled」作爲關鍵路徑,「布爾」的類型和取消選中值(使它沒有/錯)

+0

這僅適用於版本2.3,對不對? – Max 2014-09-23 17:54:56

+0

說實話,我不確定我們正在運行哪個版本,如果這些版本不存在,我很抱歉2.3 – RndmTsk 2014-09-24 14:41:37