Button.titleLabel.textAlignment = Nstextalignmentleft; This sentence is invalid
button.contenthorizontalalignment = uicontrolcontenthorizontalalignmentleft;
Button.titleedgeinsets = Uiedgeinsetsmake (0, 10, 0, 0);
Use here
Button.titleLabel.textAlignment = Nstextalignmentleft; This line of code is not effective, it just makes the text in the label left-aligned, but
Does not change the alignment of the label in the button.
So, first we have to use
Button.contenthorizontalalignment = Uicontrolcontenthorizontalalignmentleft; This line of code, put the contents of the button (control)
Alignment is modified to horizontal left alignment, but this will be close to the left, not good-looking,
So we can also modify the attributes:
Button.titleedgeinsets = Uiedgeinsetsmake (0, 10, 0, 0); This line of code can make the content (control) of the button 10 pixels to the left, so it looks much better.