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设置为tableView的tableHeaderVie,圆角设置跟topBottomMargin属性无效 #58

Open
LemonChao opened this issue Apr 25, 2019 · 0 comments

Comments

@LemonChao
Copy link

很不错的的一个项目,感谢你的分享
但是遇到一个问题

ZCHomePagedFlowView *header = [[ZCHomePagedFlowView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, WidthRatio(164))];
_tableView.tableHeaderView= header;

@interface ZCHomePagedFlowView ()<NewPagedFlowViewDelegate,NewPagedFlowViewDataSource>
@property(nonatomic, strong) NewPagedFlowView *pageFlowView;
@end

//getter
- (NewPagedFlowView *)pageFlowView {
    if (!_pageFlowView) {
        _pageFlowView = [[NewPagedFlowView alloc] initWithFrame:CGRectMake(0, WidthRatio(10), self.frame.size.width, self.frame.size.height-WidthRatio(20))];
        _pageFlowView.delegate = self;
        _pageFlowView.dataSource = self;
        _pageFlowView.minimumPageAlpha = 0.1;
        _pageFlowView.isCarousel = YES;
        _pageFlowView.orientation = NewPagedFlowViewOrientationHorizontal;
        _pageFlowView.isOpenAutoScroll = YES;
        _pageFlowView.leftRightMargin = WidthRatio(16);
        _pageFlowView.topBottomMargin = 20;
    }
    return _pageFlowView;
}

// delegate
- (PGIndexBannerSubiew *)flowView:(NewPagedFlowView *)flowView cellForPageAtIndex:(NSInteger)index {
    PGIndexBannerSubiew *bannerView = [flowView dequeueReusableCell];
    if (!bannerView) {
        bannerView = [[PGIndexBannerSubiew alloc] init];
        bannerView.tag = index;
        bannerView.layer.cornerRadius = 4.f;
        bannerView.layer.masksToBounds = YES;
    }
    
    ZCHomeAdvModel *model = self.lunbos[index];
    [bannerView.mainImageView sd_setImageWithURL:[NSURL URLWithString:model.adv_image]];
    return bannerView;
}

但是圆角 跟topBottomMargin 属性都无效
image
跟Demo对比过好几次了,但是都无效,帮忙看看吧。多谢了!!

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

1 participant