Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No transparent view in precent VC #149

Open
TheinHtikeAung opened this issue Mar 15, 2017 · 10 comments
Open

No transparent view in precent VC #149

TheinHtikeAung opened this issue Mar 15, 2017 · 10 comments

Comments

@TheinHtikeAung
Copy link

TheinHtikeAung commented Mar 15, 2017

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)
@lkzhao
Copy link
Collaborator

lkzhao commented Mar 15, 2017

Try 0.3.4 and see if it fixes it.

For your second question:

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

@EquaI1ty
Copy link

EquaI1ty commented Jun 13, 2017

@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

@MaeseppTarvo
Copy link

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

@delox
Copy link

delox commented Dec 30, 2017

Why is it closed, it's still happening.

@frboulais
Copy link

@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 :/

@ergunkocak
Copy link

ergunkocak commented Mar 13, 2018

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

@chadparker
Copy link

chadparker commented Dec 23, 2018

@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.

@angabani
Copy link

angabani commented Feb 3, 2020

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

@garymansted
Copy link

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!

@JoeMatt JoeMatt reopened this Dec 31, 2022
@Samueleuf
Copy link

I have the dame problema today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests