symbolCollectionCell.m 803 B

123456789101112131415161718192021222324252627282930
  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 = [UIColor whiteColor];
  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, 25)];
  20. [_nameLabel setTextAlignment:NSTextAlignmentCenter];
  21. [self.contentView addSubview:_nameLabel];
  22. }
  23. return self;
  24. }
  25. @end