首页 > 移动平台 > 详细

iOS 改变Search Bar中Scope Button中文本的颜色和字体

时间:2014-08-26 22:59:26      阅读:489      评论:0      收藏:0      [点我收藏+]
- (void)initSearchbar{
    self.wineSearchBar.delegate = self;
    
    [self.wineSearchBar setScopeBarButtonTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegroundColorAttributeName, [UIFont fontWithName:GENERAL_FONT size:13], NSFontAttributeName, nil] forState:UIControlStateNormal];
    [self.wineSearchBar setScopeBarButtonTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, [UIFont fontWithName:GENERAL_FONT size:13], NSFontAttributeName, nil] forState:UIControlStateSelected];
}


要求:iOS7 +

修改颜色: [UIColor redColor], NSForegroundColorAttributeName

修改字体:[UIFont fontWithName:GENERAL_FONT size:13], NSFontAttributeName


参考来源:http://stackoverflow.com/questions/15385050/color-of-scope-button-text-in-uisearchbar/

iOS 改变Search Bar中Scope Button中文本的颜色和字体

原文:http://blog.csdn.net/willyang519/article/details/38855719

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!