简体   繁体   English

MKMapView中的自定义工具栏和搜索栏

[英]Custom toolbar and search bar in MKMapView

从ViewController类加载mkmapview时,如何在iPhone中加载默认的mapview工具栏和搜索栏

You can't get the search toolbar which you called default and the reason is that Map Application that's developed by Apple may have both (search toolbar and mapview ) separated with each others. 您无法获得称为默认值的搜索工具栏,其原因是Apple开发的Map Application可能两者(搜索工具栏和mapview)彼此分开。

So, would suggest you to use both as the separate views. 因此,建议您将两者都用作单独的视图。

myCustomSearchToolBar can be either the instance of your Custom search bar view Or UISearchBar . myCustomSearchToolBar可以是“自定义”搜索栏视图的实例,也可以是UISearchBar

[containerView addSubview:myCustomSearchToolBar];
[containerView addSubview:myMapView];
[self.view addSubview:containerView];

Go through the below blog post for creating UISearchBar. 浏览以下博客文章以创建UISearchBar。

Building a SearchView with UISearchBar and UITableView 使用UISearchBar和UITableView构建SearchView

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM