建立一个漂亮的进度条

发布于 2024-08-25 02:39:51 字数 382 浏览 4 评论 0原文

我需要一些关于如何为 iPhone 构建一个漂亮的进度条的灵感。 我想要构建的是一个自定义进度条,正如我在这里绘制的:

alt text http: //img.skitch.com/20100317-tf185nscpf41u1xp3s6fqbhux6.png

到目前为止我的方法是使用带有透明圆角矩形的PNG(上图中的灰色)。通过这个矩形,用户可以看到移动条。如果用 Quartz 绘制这个条并给它一个精美的动画(类似于 Mac OS X 进度条),那就太好了。

任何关于如何执行此操作的提示

I need some inspiration on how to build a nice progress bar for the iPhone.
What I want to build is a custom progress bar, as I've drawn here:

alt text http://img.skitch.com/20100317-tf185nscpf41u1xp3s6fqbhux6.png

My approach up to now is to use a PNG (gray in the figure above) with a transparent rounded rectangle. Through this rectangle, users see the moving bar. It would be nice to draw this bar with Quartz and give it a fancy animation (similar to the Mac OS X progress bars).

Any hints how to do this

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ま柒月 2024-09-01 02:39:51

您可以使用几个嵌套的 UIView 并控制子视图的大小,并使用不同颜色的背景来显示进度,或者您可以对 UIProgress 栏进行子类化,例如 这个幻灯片示例用于解锁具有动画的 UISlider。该示例是 UISlider,但用于动画的方法也可以用在进度条上,而不会遇到处理触摸的困难。

此处是直接指向该讨论中的代码的链接

you could use a couple nested UIViews and control the size of the childview and have different colors of backgrounds to show the progress or you could subclass the UIProgress bar like this example of the slide to unlock UISlider that has animation. The example is of a UISlider but the method used for animation could also be used on a progress bar without the difficulty of handling touches.

here is a link directly to the code from that discussion

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文