暂无描述

FKCircleAdvertCell.m 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // FKCircleBestCell.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/6/12.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKCircleAdvertCell.h"
  9. @implementation FKCircleAdvertCell
  10. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  11. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  12. if (self) {
  13. [self addAllSubViews];
  14. }
  15. return self;
  16. }
  17. - (void)addAllSubViews {
  18. self.contentView.backgroundColor = [UIColor redColor];
  19. [self.contentView addSubview:self.banerView];
  20. [self.contentView addSubview:self.pageControl];
  21. [self.pageControl mas_makeConstraints:^(MASConstraintMaker *make) {
  22. make.left.equalTo(self.banerView);
  23. make.right.equalTo(self.banerView);
  24. make.bottom.equalTo(self.banerView).offset(-8);
  25. make.height.mas_equalTo(20);
  26. }];
  27. }
  28. #pragma mark - Property
  29. - (DPBannerView *)banerView{
  30. if (_banerView == nil) {
  31. _banerView = [[DPBannerView alloc]initWithFrame:CGRectMake(0, 0, UISCREENWIDTH, CIRCLE_ADSCROLLVIEW_HEIGHT)];
  32. _banerView.backgroundColor = UIColorFromRGB(0xeeeeee);
  33. }
  34. return _banerView;
  35. }
  36. - (UIPageControl*)pageControl {
  37. if (!_pageControl) {
  38. _pageControl = [[UIPageControl alloc]init];
  39. _pageControl.currentPage = 0;
  40. _pageControl.pageIndicatorTintColor = [UIColor colorWithWhite:1.0 alpha:0.6];
  41. _pageControl.currentPageIndicatorTintColor = [UIColor whiteColor];
  42. }
  43. return _pageControl;
  44. }
  45. #pragma mark - Helper
  46. + (CGFloat)height {
  47. return CIRCLE_ADSCROLLVIEW_HEIGHT;
  48. }
  49. @end