iPhone位置按钮

Pho*_*Guy 10 iphone location button

你知道地图应用程序左下角的小位置按钮吗?有谁知道我能在哪里找到它?我查看了UIButtonType和UITabBarSystemItem但是空白了.

我更喜欢使用系统映像或某种系统,以帮助确保与其他系统功能的一致性.

mye*_*l0w 7

看看https://github.com/myell0w/MTLocation

空闲模式 搜索模式 接收位置更新模式 接收标题更新模式

我模仿谷歌地图的"定位我 - 按钮",包括4种不同的状态以及在状态之间切换时完成的动画.


bic*_*ter 7

您可以尝试使用MKUserTrackingBarButtonItem 它提供与Map应用程序上的轨道按钮相同的功能.这是一些相同的代码.

MKUserTrackingBarButtonItem *trackButton = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.mapView];
NSMutableArray *items = [[NSMutableArray alloc] initWithArray:self.bottomToolbar.items];
[items insertObject:trackButton atIndex:0];
[self.bottomToolbar setItems:items];
Run Code Online (Sandbox Code Playgroud)


Jam*_*ore 0

我不太确定这是一个系统映像。Apple 应用程序中的许多图像/按钮仅特定于该应用程序,而这个看起来就是这样。