如何以编程方式创建进度条? [英] How to create progress bar programmatically?
问题描述
我创建了一个带有 IBOutlet 进度条的视图.每当我将视图旋转到横向模式时,它都不会旋转.所以,我需要以编程方式创建进度条.
I created a view with a progress bar with an IBOutlet. Whenever I rotate the view to landscape mode, it is not rotated. So, I need to create the progress bar programmatically.
我该怎么做?
推荐答案
UIProgressView *progressView = [[UIProgressView alloc] init];
progressView.frame = CGRectMake(100,100,100,20);
[self.view addSubview:progressView];
应该让你开始.
我会在 Apple 的文档中阅读视图和视图控制器.iPhone OS 的视图编程指南详细介绍了您想要做什么.如果您还没有阅读 iPhone 应用程序编程指南和 iPhone 开发指南,我会先阅读.
I would read up on views and view controllers in Apple's documentation. The View Programming Guide for iPhone OS goes into quite a bit of detail for what you want to do. If you have not read the iPhone Application Programming Guide and the iPhone Development Guide I would do so first.
所有这些文档都可以在 developer.apple.com 上找到,也可以在 Xcode 的帮助系统中找到.
All of these documents are available on developer.apple.com, and also in the help system of Xcode.
这篇关于如何以编程方式创建进度条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!