[英]Adding a search bar and search display controller to a map view?
我正在嘗試添加搜索欄並將搜索顯示添加到地圖視圖。 我實際上並不關心如何處理搜索請求,我當前的問題是如何在地圖視圖中添加搜索欄和搜索顯示控制器以及如何進行設置。 我找不到有關此主題的任何最新文檔。
//Add and bind Searchbar Controller to your viewcontroller
- (void) viewDidLoad
{
//Don't forget to add <UISearchBarDelegate> into your .h file
yourSearchbar.delegate=self;
}
//implement search bar delegate
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
NSLog(@"%@",searchBar.text);
//next you've to setup logic to pass search text to your mapview
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.