UIlabel *l1 Lan Yi Education
Text
Font
Set font
Set Center L1 settextalignment:nstextalignmentcenter
Set Number of rows NumberOfLines
Lf.font = [Uifont fontwithname:@ "font name" size:18];
Set Center
[L Settextalignment:nstextalignmentcenter];
UIbutton
Content Settitle UI
Button Buttonwithtype (there are several styles storyboard visible in general with less because of project with picture buttons)
Button setimage normal state normal highlight state highlighted checked state selected disabled state disabled
Four states can be set in storyboard with an enabled tick off is disabled STATECONFLG can be set in different states
Buttons can be clicked to remove themselves from the settings (UIButton *) btn directly in the clicked method remove
Uitextfield
Code cannot be displayed directly because BorderStyle is not set
The property is out. Can also be called with Set method settings such as Setboderstyle
textfield.delegate=self text input Box Reverse call
The second part is to add a meeting agreement.
The text input box has some point in time
Clearbutton is always appears status shows that little X
UISlider (is similar to the control volume that can adjust the maximum minimum value adjustment three pictures callable method)
UISlider *s = [[UISlider alloc]initwithframe:cgrectmake (50, 100, 250, 30)];
S.maximumvalue = 30;
S.minimumvalue = 10;
S.value = 20;
[s Setmaximumtrackimage:[uiimage imagenamed:@ "B"] forstate:uicontrolstatenormal];
[s Setminimumtrackimage:[uiimage imagenamed:@ "C"] forstate:uicontrolstatenormal];
[s Setthumbimage:[uiimage imagenamed:@ "a"] forstate:uicontrolstatenormal];
[S addtarget:self action: @selector (slider2action:) forcontrolevents:uicontroleventvaluechanged];
[Self.view addsubview:s];
method to invoke
-(void) Slider2action: (UISlider *) s{
NSLog (@ "%f", S.value);
}
SC is a control of two or three components
-(Ibaction) Scvaluechange: (Uisegmentedcontrol *) Sender {
The output of the currently selected index is starting at 0
int x = Sender.selectedsegmentindex;
NSLog (@ "%d", x);
Outputs the currently selected title
NSString *title = [Sender titleforsegmentatindex:1];
NSLog (@ "%@", title);
}
Progress bar Uiprogressview (no interaction can only associate attributes)
The statement is called attribute *pro1;
Open a 1-second Yes Timer
-(void) {
self.pro1.progress+=0.1;
}
The progress property of Uiprogressview is the progress value above meaning the progress of each second is +0.1 length
You can set the start position of the progress in storyboard and set both sides as a picture
Uiswitch (switch storyboard to select Uiswitch when creating an associated event)
-(Ibaction) Swtich1: (Uiswitch *) Sender {
if (Sender.ison) {
Sender.ison So here is the event that the switch is open;
}else{
Here the write switch closes the event that occurs;
}
}
Uistepper (Correlate into event note set to Uistepper)
There is an important attribute of value indicating that his current number
You can set value,step and so on when storyboard create Uistepper
Step indicates no + value Added value
-(Ibaction) Uistepper1: (Uistepper *) Sender {
Self.number.text=[nsstring stringwithformat:@ "%f", Sender.value];
}//The last value used is Sender.value
Uiactivityindicatorview (association attribute) commonly known as Chrysanthemum
You can change the style and color when storyboard is created
There are two ways of doing this:
Correlate into Self.juhua
1. Start the animation [Self.juhua startanimating];
2. Stop animation [Self.juhua stopanimating];
-(Ibaction) Swtich1: (Uiswitch *) Sender {
if (Sender.ison) {
[Self.juhua startanimating];
}else{
[Self.juhua stopanimating];
}
}//When switch is turned on, the Chrysanthemum turns when the switch is turned off.
IOS Learning Note Control--Lan Yi Education