HomeCellItem.m 1.19 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
//
//  HomeCellItem.m
//  redstar
//
//  Created by admin on 15/10/30.
//  Copyright © 2015年 ZWF. All rights reserved.
//

#import "HomeCellItem.h"

@implementation HomeCellItem

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.imageView.contentMode = UIViewContentModeCenter;
        [self setTitleColor:kHomeItemTextColor forState:UIControlStateNormal];
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = [UIFont systemFontOfSize:15];
        [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self setTitleColor:[UIColor orangeColor] forState:UIControlStateSelected];
admin's avatar
admin committed
22
        
23 24 25 26 27 28 29 30 31 32
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat btnW = self.width;
    CGFloat btnH = self.height;
admin's avatar
admin committed
33
    self.imageView.frame = CGRectMake((btnW - 45) / 2 , 13, 45, 45);
34
    
admin's avatar
admin committed
35 36
    CGFloat titleH = btnH - 55;
    CGFloat titleY = 61;
37 38
    self.titleLabel.frame = CGRectMake(0, titleY, btnW, titleH);
    
admin's avatar
admin committed
39 40 41 42
//    // 设置badgeView尺寸
//    self.badgeView.x = self.width - self.badgeView.width - HMMargin;
//    
//    self.badgeView.y = 0;
43 44 45 46
    
    
}
@end