在UITableview上显示位置 [英] Display Locations on UITableview

查看:63
本文介绍了在UITableview上显示位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在UITableView中显示位置.在这里,我取一个UITextFieldUITableView.现在,我想根据在文本字段中键入的关键字在表视图中显示位置的名称.有人知道该怎么做吗?请帮我的朋友们.表格视图应显示建议的位置,因为有时用户可能会拼错城市名称,或者在不同国家/地区可能有相同的城市名称.

I want to display the locations in UITableView. Here I take one UITextField and UITableView. Now I want to display the name of location in the table view according to the keyword typed in the text field. Any one know how to do that? Please help me friends. The table view should bring up suggested places because sometimes user might misspell the city name or there might be the same city name in different country.

基于以上图像,您可以了解我到底需要什么.

on bases of above image You can understand what exactly i need.

推荐答案

您想要的是地理编码.您可以相当轻松地在应用程序中集成对Google的Geocoding API的调用-只需从UITextField中获取用户输入,将其发送给Google请求,然后解析返回的数据以填充UITableView的数据源.如果有多个地方可以匹配您的查询,Google甚至会在响应中提供多个建议.

What you want is geocoding. You can fairly easily integrate calls to Google's Geocoding API in your app - simply take the user input from the UITextField, send it in a request to Google, and parse the data that you get back to populate the data source for your UITableView. Google will even provide multiple suggestions in their response if there are multiple places that could match your query.

这篇关于在UITableview上显示位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆