haven't written a blog for a long time, before written an article about the UIButton picture mixed, but a bit complicated, today to a relatively simple, I believe that everyone back to need
UIButton *button=[[UIButtonalloc] initwithframe:cgrectmake(60 , (+), (+)];
//Add text
[Button settitle:@ "Descriptive text" forstate:uicontrolstatenormal];
[Button settitlecolor: [uicolorredcolor] forstate: UIControlStateNormal];
//Plus picture
[Button setimage: [UIImageimagenamed:@ "pulldown"] Forstate:uicontrolstatenormal];
//plus border
button. Layer. BorderColor=[uicolorredcolor]. Cgcolor;
button. Layer. BorderWidth=0.5;
This is the effect of the mixing without changing the position, we will definitely change the position according to the different needs of everyone.
//change the graphic position around side
< Span style= "COLOR: #000000" > button. Titleedgeinsets= uiedgeinsetsmake ( 0 Imageview Frame Size Width 0 Imageview Frame Size Width
button. Imageedgeinsets=uiedgeinsetsmake(0, button. Titlelabel. Frame. Size. Width+5,0, 0);
Description:The position of the edgeinsets is relative change, the specific people can be more code to understand
[Self. View addsubview: button];
iOS Summary _ implementation of the UIButton of the Graphic Mix (ii)