PlanCollectionViewCell.m 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // PlanCollectionViewCell.m
  3. // jiaPeiC
  4. //
  5. // Created by apple on 16/6/14.
  6. // Copyright © 2016年 JCZ. All rights reserved.
  7. //
  8. #import "PlanCollectionViewCell.h"
  9. @implementation PlanCollectionViewCell
  10. -(instancetype)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self) {
  14. self.backgroundColor = backGroundColor;
  15. [self.contentView borderColor:lineColor width:1 cornorRadios:5];
  16. CGFloat wid = frame.size.width;
  17. CGFloat hei = frame.size.height;
  18. CGFloat x,y,w,h,bd;
  19. x = 0;
  20. bd = 5;
  21. w = wid;
  22. h = (hei-10)/3.0;
  23. NSMutableArray *labelArray = [NSMutableArray array];
  24. for (int i = 0; i < 3; i ++) {
  25. y = h*i + bd;
  26. UILabel *label = [[UILabel alloc] setxywh];
  27. [label setText:@"" Font:Font14 TextColor:contentTextColor Alignment:NSTextAlignmentCenter];
  28. [self.contentView addSubview:label];
  29. [labelArray addObject:label];
  30. }
  31. _timeLabel = labelArray[0];
  32. _kemuLabel = labelArray[1];
  33. _countLabel = labelArray[2];
  34. [_timeLabel setTextColor:titleColor];
  35. [_timeLabel setFont:[UIFont scaleSize:Font16]];
  36. _timeLabel.text = @"07:00-08:00";
  37. _kemuLabel.text = @"科目二";
  38. _countLabel.text = @"已约0人 可约3人";
  39. }
  40. return self;
  41. }
  42. @end