这个问题其实可以取个巧路,大家都知道设置SearchBar的tintcolor的方法

searchBar.tintColor = [UIColor blueColor];

 

    [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil]

                         setTitleTextAttributes:

                         [NSDictionary dictionaryWithObjectsAndKeys:

                                                        [UIColor whiteColor],

                                                        UITextAttributeTextColor,

                                                        [NSValue valueWithUIOffset:UIOffsetMake(0, 1)],

                                                        UITextAttributeTextShadowOffset,nil]

                                       forState:UIControlStateNormal];

 

如此,取消按钮的颜色即为想要的颜色了!

相关文章:

  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2022-03-06
  • 2022-01-31
  • 2022-01-31
猜你喜欢
  • 2022-12-23
  • 2021-09-21
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案