Has anyone managed to color the scopebar portion of a UISearchBar, it has a tintColor property but setting it does not affect the attached scopebar UISegmentedControl. Ive got a handle on the bar to tint it but doesnt seem to work ie:
for (id subview in searchBar.subviews){
if([subview isMemberOfClass:[UISegmentedControl class]]){
UISegmentedControl *scopeBar=(UISegmentedControl *) subview;
scopeBar.tintColor=UIColorFromRGB(0x990066);
}
}
Cheers, Neil
The above approaches weren't working for me and I ended up using an iOS appearance method.
[[UISegmentedControl appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor whiteColor]];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With