每次做按钮图文上下排列的时候都要算来算去、、、
[btn setTitleEdgeInsets:UIEdgeInsetsMake(btn.imageView.frame.size.height ,-btn.imageView.frame.size.width, 0.0,0.0)];
[btn setImageEdgeInsets:UIEdgeInsetsMake(-btn.titleLabel.bounds.size.height,(btn.frame.size.width-btn.imageView.bounds.size.width)/2.0,0.0,(btn.frame.size.width-btn.imageView.bounds.size.width)/2.0)];
网友评论