自定义形状的进度视图
我正在寻找有关自定义进度视图的一些解决方案。
基本上,我想填充下面的图像来表示加载进度,就像我们在游戏中一样。
有什么想法如何实现它吗?
I'm looking out for some solution regarding the custom progress view.
Basically, i would like to fill the image below to represent the loading progress,just like the one's we have in games.
Any ideas how to achieve it??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 CoreGraphics 进行遮罩:
您的
mask.png
应该是像倒置 alpha 一样填充的非透明图像 - 黑色表示可见部分,白色表示透明。Masking using CoreGraphics:
Your
mask.png
should be non-transparent image filled like inverted alpha - black for visible parts, white for transparent.创建自定义视图类并在该类中添加动画序列以无限地按顺序显示图像。
像这样将该视图添加到主窗口
(UIWindow*)[[UIApplication共享应用].windows objectAtIndex:0];
调用 BringSubviewToFront 在您想要此加载屏幕(视图)的任何视图上显示该视图。
Create custom view class and add animation sequence in that class to show your images in sequence infinitly.
Add that view to mainwindow like this
(UIWindow*)[[UIApplication sharedApplication].windows objectAtIndex:0];
call bringSubviewToFront to show that view on any view where u want this loading screen(view).