这是我的源代码
[search setFrame:CGRectMake(listView.frame.origin.x, listView.frame.origin.y + 2,215, 52)];
[search setPlaceholder:@"Search"];
search.barTintColor = [UIColor colorWithRed:230/255.0f green:230/255.0f blue:230/255.0f alpha:1.0f];;
[search setTranslucent:NO];
search.delegate = self;
[[UITextField appearanceWhenContainedIn:[UISearchBar class], nil] setTextColor:[UIColor blackColor]];
UITextField *txfSearchField = [search valueForKey:@"_searchField"];
txfSearchField.backgroundColor = [UIColor whiteColor];
它适用于 Xcode 5.0 上的 iOS 5、6、7
将 xcode 更新到 5.1 后,我的 uisearchview 在 iOS 7 和 iOS 7.1 中不显示键盘,但在 iOS 6 及更早版本中,它可以工作。
我不知道解决方案。
你能给我一些解决方案吗?
谢谢