xcode 4 Iphone-如何添加指南针

发布于 2025-01-03 04:17:57 字数 413 浏览 0 评论 0原文

如何让指南针显示在我的应用程序中? 对象库中没有指南针,我可以将其添加到我的视图中。所以我认为必须通过代码添加指南针。 我一直在查看多个教程,但它们似乎都没有真正具有任何指南针组件。 教程之一: http://www.iphonedevsdk .com/forum/iphone-sdk-development/42992-how-do-i-make-compass.html

我已经完成了其中的所有操作,但是没有任何显示。与其他教程相同。我也一直在读说我需要在我的 .plist 中启用某些功能,但他们实际上并没有说什么。任何提示、解释或教程都会很棒!

How do I make a compass show up in my app?
There is no compass in the object library that I can just add to my view. So I figured that a compass must be added via code.
I have been looking at multiple tutorials, but none of them seem to actually have any compass components.
One of the tutorials:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/42992-how-do-i-make-compass.html

I have done everything in it, however nothing shows up. As the same for other tutorials. I had been reading as well saying that I need to enable something in my .plist, but they don't actually say what. Any tips, explanations or tutorials would be amazing!

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

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

发布评论

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

评论(1

隔岸观火 2025-01-10 04:17:57

它并不是真正的 xcode 中的拖放组件。您需要:

  • 开始监听磁力计数据
  • 将数据从弧度转换为度数
  • 创建一个包含罗盘指针图像的视图
  • 创建一个计时器,每隔一段时间告诉罗盘指针视图以动画方式平滑地显示新的磁力计读数

这就是背后的理论它。几个月前我构建我的时找不到任何简单的教程。

It's not really a drag-and-drop component in xcode. You need to:

  • Start listening for magnetometer data
  • Convert the data from radians to degrees
  • Create a view with an image for your compass needle
  • Create a timer that every so often tells the compass needle view to animate smoothly to the new magnetometer reading

That's the theory behind it. I couldn't find any simple tutorials when I built mine a few months ago.

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