zzyspace / ZYBannerView

简单易用, 显示内容定制性强的可循环轮播控件. 可以实现类似淘宝商品详情中侧拉进入详情页的功能.
MIT License
378 stars 85 forks source link

banner不在window上的话pageControl会有问题 #18

Open liyouleo911 opened 7 years ago

liyouleo911 commented 7 years ago

您好,我发现如果点击某一张banner弹出一个窗口遮住当前view controller的话,

zzyspace commented 7 years ago

是否考虑当点击某一张 banner 的时候, 手动停止定时器, 返回的时候再开启定时器?

zzyspace commented 7 years ago

后面可能考虑通过在 -scrollViewDidScroll: 中计算 scrollView 的 contentOffset 来做当前 item 的配置来计算 pageControl 的 currentPage

liyouleo911 commented 7 years ago

返回的时机不好判断啊

zzyspace commented 7 years ago
- (void)banner:(ZYBannerView *)banner didSelectItemAtIndex:(NSInteger)index
{
    [banner stopTimer];
    UIView *newWindow = [[UIView alloc] init];
    newWindow.dismissBlock = ^{
        [banner startTimer];
    };
    [newWindow show];
}

类似这样的可以吗

liyouleo911 commented 7 years ago

这样需要在所有可能的newWindow上都添加dismissBlock这个callback,自己的代码还好办,如果是第三方库提供的页面就改不了了

liyouleo911 commented 7 years ago

另外还有一个问题就是,如果一个页面同时有多个bannerView存在,你只暂停了其中一个还是不够的