我想更改 iOS 8 中 UISearchBar 中取消按钮的文本字体和颜色。我已经尝试了适用于 iOS 6 和 7 的解决方案,但它们似乎不起作用。
最佳答案
这不是我正在寻找的解决方案,但它确实有效。
let cancelButtonAttributes: NSDictionary = [NSFontAttributeName: FONT_REGULAR_16!, NSForegroundColorAttributeName: COLOR_BLUE]
UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, forState: UIControlState.Normal)
关于swift - 从 UISearchBar 更改 UIBarButtonItem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32692569/