标签:
botton.imageEdgeInsets = UIEdgeInsetsMake(- (botton.frame.size.height - botton.imageView.frame.size.height)/2, 0, (botton.frame.size.height - botton.imageView.frame.size.height)/2, 0); botton.titleEdgeInsets = UIEdgeInsetsMake(0, - (botton.imageView.frame.size.width/2 + botton.titleLabel.frame.size.width/2), 0, (botton.imageView.frame.size.width/2 + botton.titleLabel.frame.size.width/2));
核心代码:
UIEdgeInsetsMake(top, left, bottom, right);
由于Y轴通过top、bottom控制,在设置偏移量的时候要同时修改,如只修改一边,则偏移量倍数要x2(X轴同解)
标签:
原文地址:http://www.cnblogs.com/ly1992/p/4950594.html