0

我得到了iOS應用程序,其中我使用IIViewDeckController作爲側面控制器。IIViewDeckController和presentViewController

但是,當我嘗試使用presentViewController它會導致一些奇怪的效果:在所有屏幕上的灰色半透明視圖。

例如選擇圖像的頭像。

在開始的時候,我們得到了這個畫面:

enter image description here

然後我們選擇新圖像與此代碼:

- (void)startCameraControllerWithSourceType:(UIImagePickerControllerSourceType)sourceType { 
    if (![UIImagePickerController isSourceTypeAvailable:sourceType]) { 
     return; 
    } 
    UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init]; 
    cameraUI.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 
    cameraUI.allowsEditing = YES; 
    cameraUI.delegate = self; 
    [self presentViewController:cameraUI animated:YES completion:nil]; 
} 

所以你可以看到這裏presentViewController。然後我看到我的畫廊:

enter image description here

你可以看到在畫廊半透明視圖。

,取消以前的viewController /接受相片後,同樣的看法:

enter image description here

你能幫助我嗎?我應該如何刪除這個半透明視圖?

Thnx。

回答

2

爲了避免這種情況的陰影,使用方法:

[viewDeckController setShadowEnabled:NO]

+0

令人驚訝的是官方的README沒有提到這一點。 – Raptor

0

它非常簡單,從IIViewDeckController去除陰影。

[deckController setShadowEnabled:NO]; 
相關問題