2

我有一个 UISearchBar 我需要相当大(68px 的高度)。我尝试从 xib 的源代码调整大小以及从 UISearchbar 更改 UITextField 的子视图,但都没有解决问题(如下图所示):

尝试设置外观(除了高度变化外一切正常):

[[UITextField appearanceWhenContainedIn:[UISearchBar class], nil] setFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:48]];
UITextField *searchField = [self.searchBar valueForKey:@"_searchField"];
searchField.textColor = [UIColor whiteColor];
searchField.keyboardAppearance = UIKeyboardAppearanceDark;
searchField.autocorrectionType = UITextAutocorrectionTypeNo;
CGRect searchFieldRect = searchField.frame;
searchFieldRect.size.height = 100;
searchField.frame = searchFieldRect;

结果:

4

1 回答 1

1

只需使用带有文本字段通知的​​ UITextField 来判断文本何时更改并调用我的搜索方法。

于 2013-10-03T17:53:17.543 回答