iPhone location button

后端 未结 8 591
南方客
南方客 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:24

    (Warning: undocumented feature, will be rejected by AppStore, blah blah blah)

    The location button can be accessed with

    UIBarButtonItem* item = [[UIBarButtonItem alloc]
                             initWithBarButtonSystemItem:100
                                                  target:... action:...];
    

    If you just want the image, save the result returned by

    UIImage* img = [UIImage kitImageNamed:@"UIButtonBarLocate.png"];
    

提交回复
热议问题