12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- //
- // KXSelectTableViewCell.m
- // QBCS
- //
- // Created by kuxuan on 2017/6/9.
- // Copyright © 2017年 kuxuan. All rights reserved.
- //
- #import "KXSelectTableViewCell.h"
- @implementation KXSelectTableViewCell
- {
- UIButton *_contentButton;
- }
- -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
- {
- if (self==[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
- [self setupUI];
- }
- return self;
- }
- -(void)setupUI
- {
- self.contentView.backgroundColor = [UIColor KXColorWithRed:237 green:236 blue:239];
- _contentButton=[UIButton buttonWithType:UIButtonTypeCustom];
- _contentButton.userInteractionEnabled=NO;
- _contentButton.frame=CGRectMake(0, 0, SCREEN_WIDTH, 44);
- [_contentButton setTitleColor:[UIColor KXColorWithHex:0x666666] forState:UIControlStateNormal];
- [_contentButton setTitleColor:[UIColor baseColor] forState:UIControlStateHighlighted];
- _contentButton.titleLabel.font=[UIFont systemFontOfSize:14];
- [self.contentView addSubview:_contentButton];
-
- // UILabel *lineLabel=[[UILabel alloc]initWithFrame:CGRectMake(0, 43, SCREEN_WIDTH, 1)];
- // lineLabel.backgroundColor=[UIColor lineColor];
- // [self.contentView addSubview:lineLabel];
- }
- -(void)setDetailStr:(NSString *)detailStr
- {
- _detailStr=detailStr;
- [_contentButton setTitle:detailStr forState:UIControlStateNormal];
- }
- - (void)setIsSelect:(BOOL)isSelect{
- _isSelect = isSelect;
- isSelect == YES?[_contentButton setTitleColor:[UIColor baseColor] forState:UIControlStateNormal]:[_contentButton setTitleColor:[UIColor KXColorWithHex:0x666666] forState:UIControlStateNormal];
- }
- @end
|