iOS - Customizing Cancel button of UISearchBar

后端 未结 4 2291
我在风中等你
我在风中等你 2020-12-14 22:16

In my iOS5 iPhone application, i\'m setting the tint color of search bar using following code:

searchBar.tintColor = UIColorMake(@\"#EFEFEF\");
4条回答
  •  不知归路
    2020-12-14 23:15

    Since iOS5 you can edit the Navigationbar, Toolbar, Tabbar and some more with this code...

    NSDictionary *textTitleOptions = [NSDictionary dictionaryWithObjectsAndKeys:
                                              [UIColor darkGrayColor], 
                                              UITextAttributeTextColor, 
                                              [UIColor whiteColor], 
                                              UITextAttributeTextShadowColor, nil];
    [[UINavigationBar appearance] setTitleTextAttributes:textTitleOptions];
    

    I haven´t tested it with a searchbar, but it should work similar.

提交回复
热议问题