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

Black Screen problem when using with Swift #35

Open
qasimsqm opened this issue Aug 8, 2017 · 6 comments
Open

Black Screen problem when using with Swift #35

qasimsqm opened this issue Aug 8, 2017 · 6 comments
Labels

Comments

@qasimsqm
Copy link

qasimsqm commented Aug 8, 2017

Following warning appears on console while running
<UIVisualEffectView 0x7f8883c2bc70> is being asked to animate its opacity. This will cause the effect to appear broken until opacity returns to 1.
Once I show LGAlertView it turns screen into black screen. Following code is used
```
@IBAction func onClickEditProfile(sender: Any) {
let lgaView: LGAlertView = LGAlertView.init(title: "", message: "What would you like to edit?", style: LGAlertViewStyle.actionSheet, buttonTitles: ["Edit Profile", "Edit Schedule"], cancelButtonTitle: "Cancel", destructiveButtonTitle: nil, actionHandler: { (lgView: LGAlertView, index:UInt, title: String) in
if(index == 0){
self.navigationController?.pushViewController(EditProfileVC.editProfileVCLoad(), animated: true)
}else{
self.navigationController?.pushViewController(EditProfileVC.editProfileVCLoad(), animated: true)
}

        } as? LGAlertViewActionHandler, cancelHandler: { (lgView: LGAlertView) in
        lgView.dismissAnimated()
        

    }) { (lgView: LGAlertView) in
        lgView.dismiss()
    }
    lgaView.showAnimated()
}
@cjndubisi
Copy link

@qasimsqm Seems the window is getting hidden when you call show.You can fix this by immediately calling

UIApplication.shared.delegate?.window??.makeKeyAndVisible()
UIApplication.shared.delegate?.window??.isHidden = false

right after calling show

@mickeyl
Copy link

mickeyl commented Sep 21, 2017

Same here w/ Objective-C. I did not have time to properly bisect yet, but a known-good version is ref ccb3cb4.

@NikKovIos
Copy link
Collaborator

Seems that the same problem here #34

@Friend-LGA
Copy link
Owner

Please, attach some demo project with the reproducible issue. If I have time, I will take a look.

@LyricApps
Copy link

The problem seems to be in LGAlertViewHelper.h, the app window is not necessarily the first window. In my case there are "hosted" windows which are created by AVPlayerViewController before the app window.

So you can try to replace :

+ (UIWindow *)appWindow {
    return [UIApplication sharedApplication].windows[0];
}

with :

+ (UIWindow *)appWindow {
    return [UIApplication sharedApplication].delegate.window;
}

@kublaios
Copy link

kublaios commented Dec 6, 2018

Please, attach some demo project with the reproducible issue. If I have time, I will take a look.

I don't use a storyboard and have this block in application:(UIApplication *)application didFinishLaunchingWithOptions:launchOptions::

self.window = UIWindow(frame: UIScreen.main.bounds)
let initialVC = InitialViewController.init()
window!.rootViewController = initialVC
window!.makeKeyAndVisible()

That's how I can reproduce the issue and this works for me as a workaround: #35 (comment)

@NikKovIos NikKovIos added the bug label Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants