How to initiate UIProgressView to a certain value?

为君一笑 提交于 2019-12-29 09:38:07

问题


Would it be in the .h or .m and how do I do this?


回答1:


it would definitely be in the .m file.

Initialize your UIProgressView, and then call setProgress: on it.




回答2:


As defined in the UIProgressView documentation, UIProgressView has a progress property. Just set that when you create your view:

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)

would initialize a UIProgressView with its progress value set to 75%




回答3:


The .h—“header”—file is usually where information about your class goes... its structure, “what it does” rather than “how it does it”. The .m is thus probably the right place, but it'd help for you to go into more detail about how your UI is set up. Are you using Interface Builder or creating the UIProgressView programmatically? Is the class a view, a view controller, the application's delegate, or what?



来源:https://stackoverflow.com/questions/1938487/how-to-initiate-uiprogressview-to-a-certain-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!