欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

UIActionSheet和UIProgressView的组合

发布时间:2025/5/22 编程问答 42 豆豆
生活随笔 收集整理的这篇文章主要介绍了 UIActionSheet和UIProgressView的组合 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

2019独角兽企业重金招聘Python工程师标准>>>

- (void) incrementBar: (id) timer {amountDone += 1.0f;[progressView setProgress: (amountDone / 20.0)];if (amountDone > 20.0){[self.actionSheet dismissWithClickedButtonIndex:0 animated:YES];self.actionSheet = nil;[timer invalidate];} }// Load the progress bar onto an actionsheet backing -(void) action: (UIBarButtonItem *) item {amountDone = 0.0f;self.actionSheet = [[[UIActionSheet alloc] initWithTitle:@"Downloading data. Please Wait\n\n\n" delegate:nil cancelButtonTitle:nil destructiveButtonTitle: nil otherButtonTitles: nil] autorelease];progressView = [[UIProgressView alloc] initWithFrame:CGRectMake(0.0f, 40.0f, 220.0f, 90.0f)];[progressView setProgressViewStyle: UIProgressViewStyleDefault];[actionSheet addSubview:progressView];[progressView release];// Create the demonstration updates[progressView setProgress:(amountDone = 0.0f)];[NSTimer scheduledTimerWithTimeInterval: 0.35 target: self selector:@selector(incrementBar:) userInfo: nil repeats: YES];[actionSheet showInView:self.view];progressView.center = CGPointMake(actionSheet.center.x, progressView.center.y); } 效果如下:





转载于:https://my.oschina.net/u/936286/blog/131216

总结

以上是生活随笔为你收集整理的UIActionSheet和UIProgressView的组合的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。