want to display UIProgressView on UIAlertView

前端 未结 6 355
挽巷
挽巷 2021-01-03 07:45

Hi guys i want to display UIProgressView on UIAlertView for displaying the processing of uploading of the file but i have searched too much and also find on that link but si

6条回答
  •  再見小時候
    2021-01-03 07:52

    I've had problems doing this, and ended up with this:

    av = [[UIAlertView alloc] initWithTitle:@"Running" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil];
    progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar];
    progressView.frame = CGRectMake(0, 0, 200, 15);
    progressView.bounds = CGRectMake(0, 0, 200, 15);
    progressView.backgroundColor = [UIColor blackColor];
    
    [progressView setUserInteractionEnabled:NO];
    [progressView setTrackTintColor:[UIColor blueColor]];
    [progressView setProgressTintColor:[UIColor redColor]];
    [av setValue:progressView forKey:@"accessoryView"];
    
    [av show];
    

提交回复
热议问题