码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2014-08-26 22:59:26      阅读:316      评论:0      收藏:0      [点我收藏+]

标签:http   color   os   io   for   ar   cti   sp   on   

- (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   color   os   io   for   ar   cti   sp   on   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!