iPhone 位置按钮
您知道地图应用程序左下角的小位置按钮吗? 有谁知道我在哪里可以找到它? 我查看了 UIButtonType 和 UITabBarSystemItem 但一无所获。
我更喜欢使用系统映像或系统之类的东西,以帮助确保与其他系统功能的一致性。
Ya know the little location button in the lower-left corner of the Maps application? Does anybody know where I can find that? I looked in UIButtonType and UITabBarSystemItem but came up blank.
I'd prefer to use a system image or a system something-or-other, to help ensure consistency with other system functions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
看看 https://github.com/myell0w/MTLocation
我模仿了 Google 地图的“定位我”按钮,包括 4 种不同的状态以及切换时完成的动画状态之间。
Have a look at https://github.com/myell0w/MTLocation
I mimiced Google Maps' Locate Me - Button, including 4 different states and the animation that is done when switching between states.
您可以尝试使用 MKUserTrackingBarButtonItem 它提供与地图应用程序上的追踪按钮。 这是一些相同的代码。
You can try using MKUserTrackingBarButtonItem It provides the same functionality as the track button on the Map app. Here is some same code.
请注意,在 4.0 中,Maps.app 按钮中“定位我”按钮的外观已更改。 此外,
+[UIimage kitImageNamed:]
消失了,使用未记录的标识符 100 调用-[UIBarbuttonItem initWithBarButtonSystemItem:]
将返回旧式图形。Please note that in 4.0, the appearance of the "locate me" button in Maps.app button has changed. Further on,
+[UIimage kitImageNamed:]
is gone, and calling-[UIBarbuttonItem initWithBarButtonSystemItem:]
with undocumented identifier 100 will return old-style graphics.(警告:未记录的功能,将被AppStore拒绝,等等)
位置按钮可以通过以下方式访问:
如果您只想要图像,请保存返回的结果
(Warning: undocumented feature, will be rejected by AppStore, blah blah blah)
The location button can be accessed with
If you just want the image, save the result returned by
我创建了自己的图像,Apple 接受了它(与使用搜索图像进行缩放相比)。
I created my own image, and Apple accepted it (in contrast of using the search image for zooming purposes).
http://glyphish.com/ 图标库具有可用的位置按钮。
http://glyphish.com/ icon library has location button available.
我不太确定这是一个系统映像。 Apple 应用程序中的许多图像/按钮仅特定于该应用程序,而这个看起来就是这样。
I wouldn't be so sure that it's a system image. Many images/buttons in Apple's applications are specific to that application only, and this one looks to be that way.
使用此代码示例将其保存为可以在项目中使用的文件!
希望这有帮助。
use this sample of code to save it as a file that you'll be able to use in your project!
Hope this help.