How to add subview inside UIAlertView for iOS 7?

前端 未结 6 2038
悲哀的现实
悲哀的现实 2020-11-27 15:41

I am having an application on iTunes store which displays some UILabel and UIWebView on UIAlertView. According to session video,

6条回答
  •  独厮守ぢ
    2020-11-27 16:13

    Think you will get help also if you use it :)

    syncProgressBarView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
    syncProgressBarView.frame =CGRectMake(20, 55, 250, 20);
    [syncProgressBarView setProgress:0.0f animated:NO];
    syncProgressBarView.backgroundColor =[UIColor clearColor];
    [progressView addSubview:syncProgressBarView];
    

    Making a new view for sub-viewing UIProgressView

    progressView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, DeviceWidth, 100)];
    [[UIApplication sharedApplication].keyWindow addSubview:progressView];
    progressView.backgroundColor = [UIColor clearColor];
    progressView.center = [UIApplication sharedApplication].keyWindow.center;
    syncProgressBarView.frame = CGRectMake(progressView.frame.size.width/2 - 250/2, progressView.frame.size.height/2 - 10, 250, 20);
    [[UIApplication sharedApplication].keyWindow bringSubviewToFront:[progressView superview]];
    

    One more thing you have to do...

    dispatch_async(dispatch_get_main_queue(), ^{
                    [self updateProgressBar];
                });
    

提交回复
热议问题