IVTMyAccountTableViewCell.m 2.02 KB
//
//  IVTMyAccountTableViewCell.m
//  IVTMeLive
//
//  Created by xrg on 16/7/19.
//  Copyright © 2016年 Joky. All rights reserved.
//

#import "IVTMyAccountTableViewCell.h"

@implementation IVTMyAccountTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _goldImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"中国币"]];
        _goldImg.frame = CGRectMake(16 , 13, 20, 20);
        [self.contentView addSubview:_goldImg];
        
        _choice = [[UILabel alloc] initWithFrame:CGRectMake(_goldImg.frame.size.width +20, 10, 100, 30)];
        _choice.textColor = [UIColor IVTMainTextColor];
        _choice.font = [UIFont IVTH3Font];
        _choice.textAlignment = 0;
        [self.contentView addSubview:_choice];
        
        _charge = [UIButton buttonWithType:UIButtonTypeCustom];
        _charge.frame = CGRectMake(kScreenWidth - 76, 10, 60, 25);
        [_charge setTitle:@"¥6" forState:UIControlStateNormal];
        [_charge setTitleColor:[UIColor IVTLightRedColor] forState:UIControlStateNormal];
        
        _charge.titleLabel.font = [UIFont  YXFontOfSize:17];
        _charge.layer.borderWidth = 1;
        _charge.layer.borderColor = [UIColor IVTLightRedColor].CGColor;
        _charge.layer.masksToBounds = YES;
        _charge.layer.cornerRadius = 5;
        [self.contentView addSubview:_charge];

    }
    return self;
}

- (void)setAccountModel:(IVTMyAccountTableViewModel *)model
{
    _accountModel = model;
    _choice.text = [NSString stringWithFormat:@"%@中国币", _accountModel.chineseCoin];
    [_charge setTitle:[NSString stringWithFormat:@"¥%@",_accountModel.price] forState:UIControlStateNormal];
}
@end