0

我将如何实现 searchBarSearchButtonClicked 方法?当 searchBarSearchButtonClicked 到标签时,我试图将搜索栏的值传递给标签。

4

2 回答 2

0
 -(void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
  [searchBar resignFirstResponder];

    yourlabel.text = searchBar.text;

    // DO what ever you want


  }
于 2013-10-23T14:08:40.507 回答
0

像这样:

- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
  _myLabel.text = searchBar.text;
}

就是这样!

于 2013-10-23T14:09:15.063 回答