如何获取用户在搜索栏中输入的文本?
我希望能够获取用户在搜索栏中输入的文本,并比较数组中的单词。但我不知道如何从搜索栏中获取文本,我知道在java中它只是getText。
I want to be able to get the text the user entered into a search bar, and compare the words in an array. But i'm not sure how to get the text from the search bar, I know in java its just getText.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您将
UISearchBar
命名为searchBar
,您可以使用以下命令检索文本Assuming you named the
UISearchBar
justsearchBar
, you can retrieve the text with在SearchBar Delegate方法中,您可以获取搜索栏文本
In SearchBar Delegate method, you can get searchbar text