草庐IT

textFieldInsideUISearchBar

全部标签

ios - 在 Swift 中更改搜索栏占位符文本字体

我正在尝试更改搜索显示Controller中搜索栏中占位符文本的字体。我正在查看一些示例并尝试实现它们,但由于它们在Objective-C中,我无法找到任何可以开始工作的示例。例如,我试过这个:UITextField*textField=[[searchBarsubviews]objectAtIndex:1];[textFieldsetFont:[UIFontfontWithName:@"Helvetica"size:40]];但我无法通过vartextField:UITextField=UISearchBar有什么想法吗? 最佳答案

ios - 在 Swift 中更改搜索栏占位符文本字体

我正在尝试更改搜索显示Controller中搜索栏中占位符文本的字体。我正在查看一些示例并尝试实现它们,但由于它们在Objective-C中,我无法找到任何可以开始工作的示例。例如,我试过这个:UITextField*textField=[[searchBarsubviews]objectAtIndex:1];[textFieldsetFont:[UIFontfontWithName:@"Helvetica"size:40]];但我无法通过vartextField:UITextField=UISearchBar有什么想法吗? 最佳答案