Skip to content

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

@LemonChao

Description

@LemonChao

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions