button中自帶的title和image,給button設(shè)置這兩個屬性,默認是居中参歹,UIEdgeInsetsMake(0, 0, 0, 0), imageEdgeInsets和titleEdgeInsets屬性可以改變偏移量
button.imageEdgeInsets= UIEdgeInsetsMake(0, -40, 0, 0);
button.titleEdgeInsets = UIEdgeInsetsMake(0, -40, 0, 0);
向左偏移40
button中自帶的title和image,給button設(shè)置這兩個屬性,默認是居中参歹,UIEdgeInsetsMake(0, 0, 0, 0), imageEdgeInsets和titleEdgeInsets屬性可以改變偏移量
button.imageEdgeInsets= UIEdgeInsetsMake(0, -40, 0, 0);
button.titleEdgeInsets = UIEdgeInsetsMake(0, -40, 0, 0);
向左偏移40