Uikit-button
A button that creates a rectangular rounded border, where you can place a picture, or you can place text
UIButton *button1 =[uibutton Buttonwithtype:uibuttontyperoundedrect];
Button1.frame = CGRectMake (100.0, 200.0, 50.0, 20.0);
Set the name of the Button1
[Button1 settitle:@ "one" forstate:uicontrolstatenormal];
Set the color of text
[button1 Settitlecolor:[uicolor Redcolor] forstate:uicontrolstatenormal];
Button background color
Button1.backgroundcolor = [Uicolor Orangecolor];
Set the label for Button1, commonly used in the delegate method, to identify the click is the button
Button1.tag = 0;
Formatting the button title
[Button1.titlelabel Setfont:[uifont boldsystemfontofsize:20];
Set the shadow of a button
[button1 Settitlecolor:[uicolor Redcolor] forstate:uicontrolstatenormal];
Add a background image to a button
[Button1 setimage:[uiimage imagenamed:@ "mtxx4"] forstate:uicontrolstatehighlighted];
By default, when the button is disabled, the image is drawn deeper, disabling this feature, setting the property to No
button1.adjustsimagewhenhighlighted = NO;
By default, when the button is disabled, the image is drawn lighter, disables this feature, and the property is set to No
button1.adjustsimagewhendisabled = NO;
property is set to Yes to enable the button to be illuminated when pressed
button1.showstouchwhenhighlighted = YES;
[Button1 addtarget:self Action: @selector (Btnshijian:) forcontrolevents:uicontroleventtouchupinside];//Add action
Step-by-step learning iOS (UIbutton) detailed use