I created a UISearchBar
control with the bookmark icon displayed in the search field itself. I am now trying to look for ways for me to skin the bookmark button with an image. I have stumbled upon this post (refer to fourth comment) which seems to be able to do what I want to do, but only works for the x
button in the search field and not the bookmark button.
I tried the following line to change the button, but it doesn't seem to work:
[[UIButton appearanceWhenContainedIn:[UISearchBar class], nil] setBackgroundImage:[UIImage imageNamed:@"BookmarkButtonNormal.png"] forState:UIControlStateNormal];
[[UIButton appearanceWhenContainedIn:[UISearchBar class], nil] setBackgroundImage:[UIImage imageNamed:@"BookmarkButtonSelected.png"] forState:UIControlStateSelected];
Does anyone have any idea how I can go about doing this?