How can I change the font of the UIButtons in the scope bar of a UISearchBar? The font of the UISearchBar input I have already changed but this does not change it for the scope bar.
With this code I changed the UISearchBar text font and color in my AppDelegate.m.
[[UITextField appearanceWhenContainedIn:[UISearchBar class], nil] setDefaultTextAttributes:@{NSForegroundColorAttributeName:FONT_COLOR, NSFontAttributeName:NAVIGATION_BAR_FONT}];
u can use this code:
UIFont *font = [UIFont fontWithName:@"ur font name" size:10];
NSDictionary *attributes = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
[your segmentName setTitleTextAttributes:attributes forState:UIControlStateNormal];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.