用于预加载应用程序的 UIProgressView
有谁知道制作在应用程序加载时动画的加载栏的教程吗?除了用我不想要的按钮为其设置动画之外,我在任何地方都找不到任何东西。
Does anyone know of any tutorials for making a loading bar that animates as the app is loading? I can't find anything anywhere besides animating it with a button which I don't want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
iPhone 应用程序加载的工作方式如下。
启动时,它会显示您在构建设置中指定的“启动图像”png 图像。 (一个很酷的技巧是将该屏幕截图作为您的第一个屏幕。它使您的应用程序看起来像是立即启动的)。
然后控制权传递给您的 Main.m 函数,该函数将构建您的窗口。
您要做的就是设置启动图像。然后构建一个新视图,并调用 main.m 函数。
查看 Erica Sadun 的 Iphone Cookbook 了解更多详细信息。 (或者只是浏览源代码,她几乎所有应用程序都是通过 Main.m 构建的)。
iPhone app loading works like this.
On launch it puts up the 'Launch Image' png image, that you specify in your build settings. (A cool trick is to make that a screen shot your first screen. It makes your app look like it launch instantly).
Then control passes to your Main.m function, which builds your windows.
What you will want to do, is set your launch image. Then build a new view which you call off your main.m function.
Check out Erica Sadun's Iphone Cookbook for more details. (Or just browse though the source code, she builds almost all of her apps off the Main.m).
关于使用 UIProgressView 的文档是很清楚。
在您的情况下,从应用程序委托加载您的第一个视图控制器,以便在加载应用程序的其余部分时显示 UIProgressBar 是可见的。
然后开始加载应用程序数据的其余部分(无论是什么)。
UIProgressView 的进度由 0 到 1.0 之间的浮点数表示。
要设置进度,请调用:
The docs on using UIProgressView are pretty clear.
In your case, load up your first view controller from your app delegate, so that it is visible for displaying your UIProgressBar while the rest of the app loads.
Then begin the rest of the app data loading (whatever it may be).
The progress of a UIProgressView is represented by a float between 0 and 1.0.
To set the progress, call: