How do I change the UISearchbar cancel button's text color

后端 未结 6 1103
醉梦人生
醉梦人生 2020-12-31 18:05

I have a UISearchBar as seen below. How can I change the text color for the cancel button?

\"enter

6条回答
  •  说谎
    说谎 (楼主)
    2020-12-31 18:57

    You can subclass UISearchBar and write your own - (void)layoutSubviews method. In this method, loop through its subviews and get the cancelButton. The rest should be straight forward.

提交回复
热议问题