-
Notifications
You must be signed in to change notification settings - Fork 175
Open
Description
很不错的的一个项目,感谢你的分享
但是遇到一个问题
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;
}
Metadata
Metadata
Assignees
Labels
No labels
