ios Switch Slider Progress Alert ActionSheet

1.UISwitch设置打开时按钮颜色

    [switch1 setOnTintColor:[UIColor purpleColor]];

2.UISwitch判断是否打开

    if (mySwitch.on) {
        NSLog(@"打开了");
    }else{
        NSLog(@"关了");
    }

2.设置关闭时按钮颜色

    [switch1 setTintColor:[UIColor orangeColor]];

3.UISlider设置最大值、最小值、当前值

    [mySlider setMaximumValue:100];
    [mySlider setMinimumValue:20];
    [mySlider setValue:20];

4.UIProgressView设置值

[myProgressView setProgress:0.5];

5.UIAlertView的创建和显示

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert"
 message:@"message" delegate:self cancelButtonTitle:@"Cancel"
 otherButtonTitles:@"OK",  @"hehe", @"df", nil];
    [alert show];

6.UIAlertView按钮点击代理事件(buttonIndex从0开始)

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{}

7.UIActionSheet的创建和显示

    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Title" 
delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:@"ok" otherButtonTitles:@"1", @"2", nil];
    [actionSheet showInView:self.view];

8.UIActionSheet按钮点击代理事件(buttonIndex从0开始)

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{}


你可能感兴趣的:(ios Switch Slider Progress Alert ActionSheet)