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

后端 未结 6 1102
醉梦人生
醉梦人生 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 19:03

    KVC

    UIButton *button = [_searchBar valueForKey:@"_cancelButton"]; button.titleLabel.font = [UIFont systemFontOfSize:13];

提交回复
热议问题