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

如果旋转屏幕后和旋转屏幕前NewPagedFlowView的size大小不一样,就会出现轮播内部子视图大小不改变 #10

Open
zhaiyuhao opened this issue Sep 9, 2016 · 2 comments

Comments

@zhaiyuhao
Copy link

我的方法是:
在 layoutSubviews中添加一段
[_reusableCells removeAllObjects];
_visibleRange = NSMakeRange(0, 0);
// 添加 的是下面这个for循环
for (UIView *view in _cells) {
if ([view isKindOfClass:[UIView class]]) {
[view removeFromSuperview];
}
}

同时在改写:

  • (void)reloadData
    {
    _needsReload = YES;
    [self stopTimer];
    [self setNeedsLayout];
    }

然后在加载NewPagedFlowView的类旋转的方法中添加如下代码

  • (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator {
    if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
    [coordinator animateAlongsideTransition:^(id context) {
    [self.newPagedFlowView reloadData];
    } completion:NULL];
    }
    }
@PageGuo
Copy link
Owner

PageGuo commented Sep 9, 2016

这个reload,您看最新的代码了吗?

@LWiding
Copy link

LWiding commented Dec 10, 2016

适配问题没有考虑吧 在苹果5和6上左右间距是不一样的该怎么调呢

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

3 participants