CGFloat space = 3;
_nameBtn.titleEdgeInsets = UIEdgeInsetsMake(0, - _nameBtn.imageView.v_width - space, 0, _nameBtn.imageView.v_width +space);
_nameBtn.imageEdgeInsets = UIEdgeInsetsMake(0,_nameBtn.titleLabel.v_width + space, 0, - _nameBtn.titleLabel.v_width - space);
上下位置交换
- (void)resetBtnUI:(UIButton *)btn{
[btn setTitleEdgeInsets:UIEdgeInsetsMake(50,- btn.imageView.size.width, 0, 0)];
[btn setImageEdgeInsets:UIEdgeInsetsMake(-50, 0, 0,- btn.titleLabel.size.width)];
}
网友评论