Button.contenthorizontalalignment = Uicontrolcontenthorizontalalignmentleft;
Button.titleedgeinsets = Uiedgeinsetsmake (0, 10, 0, 0);
First of all, use button.titleLabel.textAlignment = Nstextalignmentleft here; This line of code is not effective, it just makes the text in the label left-justified, but does not change the alignment of the label in the button.
So we use button.contenthorizontalalignment = Uicontrolcontenthorizontalalignmentleft;
This line of code, the content (control) of the button to modify the alignment to horizontal left-aligned, but this will be tightly to the left, not good-looking, so we can also modify the properties: Button.titleedgeinsets = Uiedgeinsetsmake (0, 10, 0, 0);
This line of code allows the button's contents (controls) to be 10 pixels from the left, which makes it much more attractive.
Text/will not learn the core (Jane book author)
Original link: http://www.jianshu.com/p/737553cd8eb5
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".
Placement of fonts inside the IOS button