1.
[
nextBtn
setContentHorizontalAlignment
:
UIControlContentHorizontalAlignmentRight
];//设置文字图片左/右对齐方法
2.设置了title 和image后默认左图右文字
3./***左文字右图的方法*/
CGSize size = [title sizeWithAttributes:[NSDictionardictionaryWithObjectsAndKeys:theFont,NSFontAttributeName, nil]];
UIImage *image = nextBtn.imageView.image;
nextBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -image.size.width, 0, image.size.width);
nextBtn.imageEdgeInsets = UIEdgeInsetsMake(0, size.width, 0, -size.width);