symbolCollectionCell.m 948 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // symbolCollectionCell.m
  3. // jiaPei
  4. //
  5. // Created by apple on 16/1/5.
  6. // Copyright © 2016年 JCZ. All rights reserved.
  7. //
  8. #import "symbolCollectionCell.h"
  9. @implementation symbolCollectionCell
  10. -(instancetype)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self)
  14. {
  15. self.backgroundColor = backGroundColor;
  16. CGFloat width = (self.frame.size.width - 40)*1.0;
  17. _image = [[UIImageView alloc] initWithFrame:CGRectMake(20, 15, width, width)];
  18. [self.contentView addSubview:_image];
  19. _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, width + 20, width, self.frame.size.height - (width + 20))];
  20. _nameLabel.textColor= kTitleColor;
  21. [_nameLabel setTextAlignment:NSTextAlignmentCenter];
  22. _nameLabel.adjustsFontSizeToFitWidth = YES;
  23. _nameLabel.numberOfLines = 0;
  24. [self.contentView addSubview:_nameLabel];
  25. }
  26. return self;
  27. }
  28. @end