// // hotAskMoreFootCell.m // ThePaperHD // // Created by scar1900 on 15/1/28. // Copyright (c) 2015年 scar1900. All rights reserved. // #import "hotAskMoreFootCell.h" @interface hotAskMoreFootCell() @property(nonatomic, strong)UIButton *moreButton; @property(nonatomic, strong)UIView *lineView1; @property(nonatomic, strong)UIView *lineView2; @property(nonatomic, strong)UIView *lineView3; @end @implementation hotAskMoreFootCell @synthesize commentBO; @synthesize delegate; - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.selectionStyle = UITableViewCellSelectionStyleNone; self.backgroundColor = [UIColor colorWithHexString:CardBackGroundColor]; [self addSubview:self.moreButton]; [self addSubview:self.lineView1]; [self addSubview:self.lineView2]; [self addSubview:self.lineView3]; }return self; } - (UIButton*)moreButton { if (!_moreButton) { _moreButton = [UIButton buttonWithType:UIButtonTypeCustom]; _moreButton.backgroundColor = [UIColor colorWithHexString:CardBackGroundColor]; [_moreButton setTitle:@"查看更多回答" forState:UIControlStateNormal]; [_moreButton setTitleColor:[UIColor colorWithHexString:BLUECOLOR] forState:UIControlStateNormal]; [_moreButton setTitleColor:[UIColor colorWithHexString:TextGray] forState:UIControlStateHighlighted]; [_moreButton addTarget:self action:@selector(checkMoreAnswer) forControlEvents:UIControlEventTouchUpInside]; _moreButton.titleLabel.font = appFont(15, NO); } return _moreButton; } - (UIView*)lineView1 { if (!_lineView1) { _lineView1 = [[UIView alloc]initWithFrame:CGRectZero]; _lineView1.backgroundColor = [UIColor colorWithHexString:LINECOLOR]; } return _lineView1; } - (UIView*)lineView2 { if (!_lineView2) { _lineView2 = [[UIView alloc]initWithFrame:CGRectZero]; _lineView2.backgroundColor = [UIColor colorWithHexString:LINECOLOR]; } return _lineView2; } - (UIView*)lineView3 { if (!_lineView3) { _lineView3 = [[UIView alloc]initWithFrame:CGRectZero]; _lineView3.backgroundColor = [UIColor colorWithHexString:LINECOLOR]; } return _lineView3; } - (void)checkMoreAnswer { if ([self.delegate respondsToSelector:@selector(clickAskMoreButton:)]) { [self.delegate clickAskMoreButton:self.commentBO]; } } - (void)layoutSubviews { self.moreButton.frame = CGRectMake(90, 0, CGRectGetWidth(self.bounds)-90, 34); self.lineView3.frame =CGRectMake(CGRectGetMinX(self.moreButton.frame), CGRectGetHeight(self.moreButton.frame), CGRectGetWidth(self.moreButton.frame), 1); self.lineView2.frame =CGRectMake(CGRectGetMinX(self.moreButton.frame), CGRectGetHeight(self.moreButton.frame)+2, CGRectGetWidth(self.moreButton.frame), 1); self.lineView1.frame =CGRectMake(CGRectGetMinX(self.moreButton.frame), CGRectGetHeight(self.moreButton.frame)+4, CGRectGetWidth(self.moreButton.frame), 1); [super layoutSubviews]; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end