如何将UIProgressView启动到某个值?

时间:2009-12-21 06:15:57

标签: iphone objective-c cocoa-touch uiprogressview

它会在.h还是.m中,我该怎么做?

3 个答案:

答案 0 :(得分:13)

根据UIProgressView documentation的定义,UIProgressView具有progress属性。只需在创建视图时设置:

UIProgressView *view = [[UIProgressView alloc] initWithProgressViewStyle:whateverStyle];
view.progress = 0.75f;
// Do whatever you want with the view
// (and don't forget to -release it later)

会初始化UIProgressView,其进度值设置为75%

答案 1 :(得分:3)

它肯定会出现在.m文件中。

初始化您的UIProgressView,然后在其上调用setProgress:

答案 2 :(得分:0)

.h-“header”-file通常是关于你的类的信息...它的结构,“它做什么”而不是“它是如何做到的”。因此,.m可能是正确的地方,但它有助于您详细了解UI的设置方式。您是使用Interface Builder还是以编程方式创建UIProgressView?该类是视图,视图控制器,应用程序的委托还是什么?