Create
UIButton *left = [Uibuttonbuttonwithtype:uibuttontypecustom];
Set text
[Left settitle:@ ' left ' forstate:uicontrolstatenormal];
Set Stylistic size
Left.titleLabel.font = [uifontsystemfontofsize:25.0];
Set Text color
[Left Settitlecolor:[uicolorblackcolor]forstate:uicontrolstatenormal];
Set Background color
Left.backgroundcolor =uicolorfromrgb (0xf3f333);
Left.contentmode =uiviewcontentmodetopright;
Set Rectangle four fillet radius
[left.layersetcornerradius:10.0];
Setting up a handler function
[Left Addtarget:selfaction: @selector (leftbuttonpressed:) Forcontrolevents:uicontroleventtouchdown];
Left.frame =cgrectmake (0,400,100, 50);
Set the background image
[Left setimage:[uiimageimagenamed:@ "BLUE_BG (2). png"] forstate:uicontrolstatenormal];
[leftsetalpha:0.5];//Set transparency
Set left-aligned
Songbtn.contenthorizontalalignment =uicontrolcontenthorizontalalignmentleft;
To set the bottom alignment
Songbtn.contentverticalalignment = Uicontrolcontentverticalalignmentbottom;