// // FKCircleBestCell.m // FirstLink // // Created by jack on 16/6/12. // Copyright © 2016年 FirstLink. All rights reserved. // #import "FKCircleAdvertCell.h" @implementation FKCircleAdvertCell - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { [self addAllSubViews]; } return self; } - (void)addAllSubViews { self.contentView.backgroundColor = [UIColor redColor]; [self.contentView addSubview:self.banerView]; [self.contentView addSubview:self.pageControl]; [self.pageControl mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.banerView); make.right.equalTo(self.banerView); make.bottom.equalTo(self.banerView).offset(-8); make.height.mas_equalTo(20); }]; } #pragma mark - Property - (DPBannerView *)banerView{ if (_banerView == nil) { _banerView = [[DPBannerView alloc]initWithFrame:CGRectMake(0, 0, UISCREENWIDTH, CIRCLE_ADSCROLLVIEW_HEIGHT)]; _banerView.backgroundColor = UIColorFromRGB(0xeeeeee); } return _banerView; } - (UIPageControl*)pageControl { if (!_pageControl) { _pageControl = [[UIPageControl alloc]init]; _pageControl.currentPage = 0; _pageControl.pageIndicatorTintColor = [UIColor colorWithWhite:1.0 alpha:0.6]; _pageControl.currentPageIndicatorTintColor = [UIColor whiteColor]; } return _pageControl; } #pragma mark - Helper + (CGFloat)height { return CIRCLE_ADSCROLLVIEW_HEIGHT; } @end