iOS7修改UISearchBar的Cancel按钮的颜色和文字

两行代码搞定:

[[UIBarButtonItem appearanceWhenContainedIn: [UISearchBar class], nil] setTintColor:[UIColor whiteColor]];    
[[UIBarButtonItem appearanceWhenContainedIn: [UISearchBar class], nil] setTitle:@"取消"];

查了很多,试了很多。唯一work的东东。就是这两行代码。

enjoy

你可能感兴趣的:(search)