ZanButton.m 760 Bytes
//
//  ZanButton.m
//  redstar
//
//  Created by admin on 15/11/2.
//  Copyright © 2015年 ZWF. All rights reserved.
//

#import "ZanButton.h"

@implementation ZanButton


// 修改按钮内部子控件的frame
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    // 1.imageView
    CGFloat imageX = 5;
    CGFloat imageY = 0;
    CGFloat imageW = 17;
    CGFloat imageH = 18;
    self.imageView.frame = CGRectMake(imageX, imageY, imageW, imageH);
    
    
    // 2.title
    CGFloat titleX = imageW + imageX + 4;
    CGFloat titleY = 1;
    CGFloat titleW = self.bounds.size.width - (imageW + imageX + 4);
    CGFloat titleH = self.bounds.size.height - titleY;
    self.titleLabel.frame = CGRectMake(titleX , titleY, titleW, titleH);
    
}


@end