iPhone location button

后端 未结 8 584
南方客
南方客 2021-02-05 23:28

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 b

8条回答
  •  情书的邮戳
    2021-02-06 00:13

    You can try using MKUserTrackingBarButtonItem It provides the same functionality as the track button on the Map app. Here is some same code.

    MKUserTrackingBarButtonItem *trackButton = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.mapView];
    NSMutableArray *items = [[NSMutableArray alloc] initWithArray:self.bottomToolbar.items];
    [items insertObject:trackButton atIndex:0];
    [self.bottomToolbar setItems:items];
    

提交回复
热议问题