Giter Site home page Giter Site logo

有个bug about zhpopupcontroller HOT 6 CLOSED

snail-z avatar snail-z commented on May 14, 2024
有个bug

from zhpopupcontroller.

Comments (6)

snail-z avatar snail-z commented on May 14, 2024

怎么会连续弹出两个view?能说下具体情况吗 或是你的使用场景是什么样的?

from zhpopupcontroller.

392222523 avatar 392222523 commented on May 14, 2024

在网络请求失败的时候弹窗,然后一个页面有2个请求,没网络状态会弹2个

from zhpopupcontroller.

392222523 avatar 392222523 commented on May 14, 2024

SnailAlertView *alert = [[SnailAlertView alloc] initWithTitle:title message:message fixedWidth:300];
alert.linesHidden = YES;

SnailAlertButton *can = [SnailAlertButton cancelButtonWithTitle:cancelTitle handler:cancel];

can.edgeInset = UIEdgeInsetsMake(20, 20, 20, 20);
can.backgroundColor = [UIColor whiteColor];
[can.layer setBorderColor:[[UIColor blackColor] CGColor]];

can.layer.borderWidth = 0.5;
[can.layer masksToBounds];

[can setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];

[alert addAction:can];


AppDelegate *ad = (AppDelegate*)[UIApplication sharedApplication].delegate;
ad.window.sl_popupController = [SnailPopupController new];

ad.window.sl_popupController.maskType = PopupMaskTypeBlackBlur;
ad.window.sl_popupController.transitStyle = PopupTransitStyleShrinkInOut;
[ad.window.sl_popupController presentContentView:alert duration:0.5 elasticAnimated:YES];

from zhpopupcontroller.

392222523 avatar 392222523 commented on May 14, 2024

ad.window.sl_popupController = [SnailPopupController sl_popupController];
用这个初始化,会有个蒙版消失不了.检查视图发现还是2个view.dismiss不掉.

from zhpopupcontroller.

392222523 avatar 392222523 commented on May 14, 2024
  • (void)buttonClicked:(UIButton *)sender {
    NSString *selName = [NSString stringWithFormat:@"example%lu", sender.tag + 1];
    SEL sel = NSSelectorFromString(selName);
    if ([self respondsToSelector:sel]) {
    self.title = _styles[sender.tag];
    [self performSelector:sel withObject:nil afterDelay:0];
    [self performSelector:sel withObject:nil afterDelay:0]; // 在demo中连续调用2次就会出现.

    }
    }

from zhpopupcontroller.

snail-z avatar snail-z commented on May 14, 2024

确实有这个问题,我已经做了修改。
不过叠加弹出窗口应该是不合理的,另外这样操作相当于创建了两个不同的对象赋给了self.sl_popupController ,所以前一个已经delloc了 ,但是视图没有消失(这是个bug)。如果非要同时叠加多个,应该创建多个不同的全局变量来保存每个对象。

from zhpopupcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.