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

Popup doesn't show at all #36

Open
xarlotie opened this issue Aug 20, 2015 · 11 comments
Open

Popup doesn't show at all #36

xarlotie opened this issue Aug 20, 2015 · 11 comments

Comments

@xarlotie
Copy link

Even the basic example doesn't work. No error. No popup. Just nothing.

@TolgaB
Copy link

TolgaB commented Aug 22, 2015

It works. Can you post you're code.

@xarlotie
Copy link
Author

I just used your sample code and inserted it in my codes.

- (void) switchChanged:(id)sender {
    UISwitch * switchControl = sender;
    NSLog( @"SWITCH The switch is %@", switchControl.on ? @"ON" : @"OFF" );

    if(switchControl.on) {
        NSLog(@"SWITCH Show it!");
        [self.popup show];
    }
}

- (KLCPopup *) popup{
    if (_popup == nil){
        UIView* contentView = [[UIView alloc] init];
        contentView.translatesAutoresizingMaskIntoConstraints = NO;
        contentView.backgroundColor = [UIColor whiteColor];
        contentView.layer.cornerRadius = 12.0;

        UILabel* dismissLabel = [[UILabel alloc] init];
        dismissLabel.translatesAutoresizingMaskIntoConstraints = NO;
        dismissLabel.backgroundColor = [UIColor clearColor];
        dismissLabel.textColor = [UIColor whiteColor];
        dismissLabel.font = [UIFont boldSystemFontOfSize:72.0];
        dismissLabel.text = @"Hi.";

        [contentView addSubview:dismissLabel];

        _popup = [KLCPopup popupWithContentView:contentView];
    }

    return _popup;
}

@TolgaB
Copy link

TolgaB commented Aug 24, 2015

Try doing it this way,

KLCPopup* popup = [KLCPopup popupWithContentView:contentView];
popup.dimmedMaskAlpha = .85;
[popup show];

@xarlotie
Copy link
Author

I already copied the whole ViewController code in your example and calls that controller within my app but the popup still does not appear. I also tried other popup libraries but they all don't show up. What could be the problem?

@xarlotie
Copy link
Author

I found the real culprit. I tried it on iOS 7.1 and it worked. It is not working on iOS 8 (as tested on iOS 8.1 and 8.4).

What do you think is the problem here? Thanks!

@xarlotie
Copy link
Author

I tried to run the sample project included in this repo on an ios 8.4 simulator and it worked. But i still can't figure out why it doesn't work when included within my application. Any help will be so much appreciated. Thanks!

@chatdanai
Copy link

in KLCPopup.m
replace line 538 from
if (window.windowLevel == UIWindowLevelNormal) {

to

if (window.windowLevel == UIWindowLevelNormal && window.hidden == NO) {

may be help

@umutafacan
Copy link

@chatdanai Thanks a lot.
It should be updated like that.

@AnthoPakPak
Copy link

@chatdanai Thanks !!! Suddenly KLC didn't showed up anymore, whereas it has been working for months very well. The only thing I've done is adding Firebase and Google frameworks, weird... If someone has an explanation for this 👍
Your solution worked for me !!!

@amtung
Copy link

amtung commented Aug 11, 2017

@chatdanai your solution worked! I'm just curious, the pod has been working fine for months and suddenly stop working. Do you have an explanation for this?

@chatdanai
Copy link

@amtung I haven't dug into the detail. I thought when ios updated, window, view structure may be change.

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

No branches or pull requests

6 participants