iOS 版 XCode 中的动画进度条

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12068481/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:17:40  来源:igfitidea点击:

Animate progress bar in XCode for iOS

objective-ciosxcode

提问by Boban

Possible Duplicate:
How to initiate UIProgressView to a certain value?

可能的重复:
如何将 UIProgressView 初始化为某个值?

I would like to create a simple progress bar animation in XCode. So, when I open page it should animate to the specific percentage. I am not that familiar with XCode, that's why I ask here. I tried to google that, but no specific solution. Is there any advice on this? I also have looked at some advises here at SO, but no luck.

我想在 XCode 中创建一个简单的进度条动画。因此,当我打开页面时,它应该动画显示特定百分比。我对 XCode 不太熟悉,这就是我在这里问的原因。我试图用谷歌搜索,但没有具体的解决方案。对此有什么建议吗?我也在 SO 上查看了一些建议,但没有运气。

Thanks for any help in advance.

提前感谢您的任何帮助。

回答by Nikita Pestrov

UIProgressView has a method to set it's progress with animation. Just call that when you create your view:

UIProgressView 有一个方法来设置它的动画进度。只需在创建视图时调用它:

UIProgressView *view = [[UIProgressView alloc] initWithProgressViewStyle:someStyle];
[view setProgress:0.7 animated:YES];