基于当前时间的物体角度
仔细听,因为这是具体的。我正在尝试在 iPhone SDK 中制作一个模拟时钟。我已经尝试完成这个任务三个星期了,我已经问了五个问题,但我仍然几乎什么也没找到。我需要帮助。我想要一个只根据当前时间旋转的时钟指针。我现在主要关注二手,因为它看起来是最简单的。
我不一定关心用什么来旋转时钟指针(CALayers、UIView 等),只要它做它需要做的事情即可。非常非常感谢任何形式的帮助。谢谢。
编辑:我还需要手作为图像。希望这还不算太多。 :(
Listen carefully, because this is specific. I'm trying to make an analog clock in iPhone SDK. I've been trying to accomplish this for three weeks now, I've asked five questions on SO, and I still have found almost NOTHING. I need help. I want to have a clock hand that simply rotates depending on the current time. I'm mostly focused on the second hand right now because it seems like the easiest.
I don't necessarily care what is used to rotate the clock hand (CALayers, UIView, etc.), just as long as it does what it needs to do. Any sort of help is greatly, greatly appreciated. Thanks.
EDIT: I also need the hands to be images. Hopefully that isn't too much. :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您问了同样的问题,我说图层要好得多。 .. 这次我在不到三周的时间内编写了这个洞程序;)。
如果你想使用图像,那么获取你的图像并将它们设置在
initWithFrame:
接口:ClockView.h
实现:ClockView.m
用法:
You asked kind of the same question and I said that Layers is much better... well this time I have written the hole program in a record time than less than three weeks ;).
If you want to use images then get your images and set them inside
initWithFrame:
Interface: ClockView.h
Implementation: ClockView.m
Usage:
三个星期?认真的吗?
我的时钟很丑陋,但它是一个时钟,而且看起来足够好,可以从中猜测当前时间。
three weeks? Seriously?
my clock is very fugly but it is a clock, and it looks good enough to guess the current time from it.