GGBannerCollectionViewCell.m 1.1 KB

12345678910111213141516171819202122232425262728
  1. //
  2. // GGBannerCollectionViewCell.m
  3. // GGBannerViewDemo
  4. //
  5. // Created by GuinsooMBP on 15/10/16.
  6. // Copyright (c) 2015年 gaonan. All rights reserved.
  7. //
  8. #import "GGBannerCollectionViewCell.h"
  9. @implementation GGBannerCollectionViewCell
  10. - (instancetype)initWithFrame:(CGRect)frame {
  11. self = [super initWithFrame:frame];
  12. if (self) {
  13. self.imageView = [[UIImageView alloc]init];
  14. // self.imageView.translatesAutoresizingMaskIntoConstraints = NO;
  15. self.imageView.frame = CGRectMake(0, 0, kScreenW, kScreenH);
  16. self.imageView.contentMode = UIViewContentModeScaleAspectFill;
  17. self.imageView.clipsToBounds = YES;
  18. [self.contentView addSubview:self.imageView];
  19. // [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[_imageView]-0-|" options:0 metrics:0 views:NSDictionaryOfVariableBindings(_imageView)]];
  20. // [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[_imageView]-0-|" options:0 metrics:0 views:NSDictionaryOfVariableBindings(_imageView)]];
  21. }
  22. return self;
  23. }
  24. @end