1.UISwitch设置打开时按钮颜色ide
[switch1 setOnTintColor:[UIColor purpleColor]];
2.UISwitch判断是否打开代理
if (mySwitch.on) { NSLog(@"打开了"); }else{ NSLog(@"关了"); }
2.设置关闭时按钮颜色code
[switch1 setTintColor:[UIColor orangeColor]];
3.UISlider设置最大值、最小值、当前值事件
[mySlider setMaximumValue:100]; [mySlider setMinimumValue:20]; [mySlider setValue:20];
4.UIProgressView设置值it
[myProgressView setProgress:0.5];
5.UIAlertView的建立和显示io
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", @"hehe", @"df", nil]; [alert show];
6.UIAlertView按钮点击代理事件(buttonIndex从0开始)class
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{}
7.UIActionSheet的建立和显示cli
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Title" delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:@"ok" otherButtonTitles:@"1", @"2", nil]; [actionSheet showInView:self.view];
8.UIActionSheet按钮点击代理事件(buttonIndex从0开始)im
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{}