// // HeadCell.m // jiaPei // // Created by apple on 15/11/12. // Copyright (c) 2015年 JCZ. All rights reserved. // #import "HeadCell.h" #import "CLButton.h" @implementation HeadCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; } - (void)layoutSubviews { [super layoutSubviews]; // CGFloat cellH = self.frame.size.height; CGFloat boarder = 10; CGFloat imgWH = 60; self.imageView.frame =CGRectMake(boarder,5,imgWH,imgWH); self.imageView.contentMode =UIViewContentModeScaleAspectFill; UIImageView* iv = self.imageView; iv.layer.cornerRadius = iv.frame.size.width/2.0; iv.layer.masksToBounds = YES; iv.layer.borderWidth = 2.0f; iv.layer.borderColor = defGreen.CGColor; self.textLabel.x = self.imageView.width + 20; self.textLabel.y = 5; self.textLabel.width = self.width - self.textLabel.x - 40; self.textLabel.height = 35; self.detailTextLabel.x = self.textLabel.x; self.detailTextLabel.y = 40; self.detailTextLabel.width = self.width - self.detailTextLabel.x - 40; self.detailTextLabel.height = 25; } - (void)createBtns { if (RQ_COMMON_MANAGER.YYXC_SERVICE_OPEN) { } else { CGFloat cellW = kLeftViewWid; CGFloat cellH = 100; // CGFloat boarder = cellH * .1; CLButton *btn; CGFloat btnW = 100; CGFloat btnH = 30; CGFloat board = (kLeftViewWid - btnW* 2 )/3; btn = [[CLButton alloc] initWithFrame:CGRectMake(board, cellH - btnH, btnW, btnH)]; [btn setImage:[[UIImage imageNamed:@"leftvc_icon1.png"] tint:defGreen] forState:UIControlStateNormal]; [btn setTitle:@"我的消息" forState:UIControlStateNormal]; [self.contentView addSubview:btn]; [btn setTitleColor:contentTextColor forState:UIControlStateNormal]; [btn setBoardWid:1 Color:defGreen]; _leftBtn = btn; [btn setStyle:1]; btn = [[CLButton alloc] initWithFrame:CGRectMake(cellW - btnW -board, cellH - btnH, btnW, btnH)]; [btn setImage:[[UIImage imageNamed:@"leftvc_icon2.png"] tint:defGreen] forState:UIControlStateNormal]; [btn setTitle:@"我的收藏" forState:UIControlStateNormal]; [self.contentView addSubview:btn]; [btn setTitleColor:contentTextColor forState:UIControlStateNormal]; [btn setBoardWid:1 Color:defGreen]; _rightBrn = btn; [btn setStyle:1]; } } @end