我在UIBarButtonItem
裏面添加了UISearchBar
按鈕。隱藏鍵盤上的單擊輸入按鈕或搜索按鈕
以下表格:
// search bar
UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 260, 44)];
UIBarButtonItem *searchBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:searchBar];
[searchBar release];
[buttons addObject:searchBarButtonItem];
現在出現在當我點擊UISearchBar
鍵盤上的問題。我想在點擊輸入或搜索按鈕時隱藏鍵盤。我怎樣才能做到這一點?
thanks..for溶液 –