Hero icon indicating copy to clipboard operation
Hero copied to clipboard

No transparent view in precent VC

Open TheinHtikeAung opened this issue 7 years ago • 10 comments

Following is my code, second view transparent is only worked with Hero default animation (fade in). If I used other animation, alpha become 1 I think.

Btw, how to set same effect on dismiss also? I used default code dismiss(animation, completion) but only fade out effect worked.

Thanks for this Hero library.

vc.modalPresentationStyle = .overFullScreen
vc.isHeroEnabled = true
vc.heroModalAnimationType = .pageIn(direction: .down)
self.present(vc, animated: true, completion: nil)

TheinHtikeAung avatar Mar 15 '17 13:03 TheinHtikeAung

Try 0.3.4 and see if it fixes it.

For your second question:

heroModalAnimationType = .selectBy(presenting: .pageIn(direction: .down), dismissing: .pageOut(direction: .down))

lkzhao avatar Mar 15 '17 18:03 lkzhao

@lkzhao Seems it still not working with 0.3.6 version. Thanks for the Hero.

vc.heroModalAnimationType = .zoom
vc.modalPresentationStyle = .currentContext
vc.view.backgroundColor = UIColor.clear

fromVC.present(vc, animated: true) {
            //...
}

But this code works if

vc.heroModalAnimationType = .fade

EquaI1ty avatar Jun 13 '17 08:06 EquaI1ty

Hey, I have the exact same problem. How to fix? .overCurrentContext is not working with .zoom but works with .fade

MaeseppTarvo avatar Aug 22 '17 17:08 MaeseppTarvo

Why is it closed, it's still happening.

delox avatar Dec 30 '17 17:12 delox

@lkzhao Is there something to do to avoid black background while presenting view controller over current context ? As @MaeseppTarvo & @EquaI1ty explained, only .fade transition works :/

frboulais avatar Feb 27 '18 09:02 frboulais

targetVC.modalPresentationStyle = .overCurrentContext targetVC.view.backgroundColor = .clear targetVC.modalPresentationCapturesStatusBarAppearance = true

works with present but if you use push it is still black for transparent areas

ergunkocak avatar Mar 13 '18 13:03 ergunkocak

@ergunkocak Thank you!!!!! Setting the presented controller's background to .clear before viewDidLoad() (either right before present(), or inside init() in presented VC) and also .modalPresentationStyle to .overCurrentContext finally got rid of the ending black background for me.

chadparker avatar Dec 23 '18 22:12 chadparker

I am facing this issue in .overCurrentContext presentation style in iOS 13.3 using heroModalAnimationType .fade animation.

angabani avatar Feb 03 '20 10:02 angabani

I am facing the same issue (presenting a controller with .zoom and wanting a transparent background) but its not possible still. If i reopen the issue would someone look into it? ps great library btw!

garymansted avatar Dec 31 '22 04:12 garymansted

I have the dame problema today

Samueleuf avatar Feb 15 '23 19:02 Samueleuf