NewPagedFlowView icon indicating copy to clipboard operation
NewPagedFlowView copied to clipboard

将NewPagedFlowView设置为tableView的tableHeaderVie,圆角设置跟topBottomMargin属性无效

Open LemonChao opened this issue 7 years ago • 0 comments

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

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对比过好几次了,但是都无效,帮忙看看吧。多谢了!!

LemonChao avatar Apr 25 '19 10:04 LemonChao