HeadCell.m 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //
  2. // HeadCell.m
  3. // jiaPei
  4. //
  5. // Created by apple on 15/11/12.
  6. // Copyright (c) 2015年 JCZ. All rights reserved.
  7. //
  8. #import "HeadCell.h"
  9. #import "CLButton.h"
  10. @implementation HeadCell
  11. - (void)awakeFromNib {
  12. [super awakeFromNib];
  13. // Initialization code
  14. }
  15. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  16. [super setSelected:selected animated:animated];
  17. }
  18. - (void)layoutSubviews {
  19. [super layoutSubviews];
  20. // CGFloat cellH = self.frame.size.height;
  21. CGFloat boarder = 10;
  22. CGFloat imgWH = 60;
  23. self.imageView.frame =CGRectMake(boarder,5,imgWH,imgWH);
  24. self.imageView.contentMode =UIViewContentModeScaleAspectFill;
  25. UIImageView* iv = self.imageView;
  26. iv.layer.cornerRadius = iv.frame.size.width/2.0;
  27. iv.layer.masksToBounds = YES;
  28. iv.layer.borderWidth = 2.0f;
  29. iv.layer.borderColor = defGreen.CGColor;
  30. self.textLabel.x = self.imageView.width + 20;
  31. self.textLabel.y = 5;
  32. self.textLabel.width = self.width - self.textLabel.x - 40;
  33. self.textLabel.height = 35;
  34. self.detailTextLabel.x = self.textLabel.x;
  35. self.detailTextLabel.y = 40;
  36. self.detailTextLabel.width = self.width - self.detailTextLabel.x - 40;
  37. self.detailTextLabel.height = 25;
  38. }
  39. - (void)createBtns {
  40. if (RQ_COMMON_MANAGER.YYXC_SERVICE_OPEN) {
  41. } else {
  42. CGFloat cellW = kLeftViewWid;
  43. CGFloat cellH = 100;
  44. // CGFloat boarder = cellH * .1;
  45. CLButton *btn;
  46. CGFloat btnW = 100;
  47. CGFloat btnH = 30;
  48. CGFloat board = (kLeftViewWid - btnW* 2 )/3;
  49. btn = [[CLButton alloc] initWithFrame:CGRectMake(board, cellH - btnH, btnW, btnH)];
  50. [btn setImage:[[UIImage imageNamed:@"leftvc_icon1.png"] tint:defGreen] forState:UIControlStateNormal];
  51. [btn setTitle:@"我的消息" forState:UIControlStateNormal];
  52. [self.contentView addSubview:btn];
  53. [btn setTitleColor:contentTextColor forState:UIControlStateNormal];
  54. [btn setBoardWid:1 Color:defGreen];
  55. _leftBtn = btn;
  56. [btn setStyle:1];
  57. btn = [[CLButton alloc] initWithFrame:CGRectMake(cellW - btnW -board, cellH - btnH, btnW, btnH)];
  58. [btn setImage:[[UIImage imageNamed:@"leftvc_icon2.png"] tint:defGreen] forState:UIControlStateNormal];
  59. [btn setTitle:@"我的收藏" forState:UIControlStateNormal];
  60. [self.contentView addSubview:btn];
  61. [btn setTitleColor:contentTextColor forState:UIControlStateNormal];
  62. [btn setBoardWid:1 Color:defGreen];
  63. _rightBrn = btn;
  64. [btn setStyle:1];
  65. }
  66. }
  67. @end