iOS 改变Search Bar中Scope Button中文本的颜色和字体
2014-08-26 22:49
447 查看
- (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中文本的颜色和字体
- 图形的绘制,如何使用自定义画笔(颜色,线宽,线形)。如何为程序中添加选项菜单和选项设置对话框,如何使用标准颜色对话框,如何使用字体对话框,在选项对话框中实现预览功能。实现选项对话框和窗口类中的数据交换。如何改变对话框和控件的背景色,如何改变控件的文本颜色,
- VC 编辑框 改变背景、字体、文本颜色、长度限制、英文 汉字判断收藏
- VC 编辑框 改变背景、字体、文本颜色、长度限制、英文 汉字判断
- IOS_改变UITextField placeHolder颜色、字体
- ios开发之改变UIWebView文本字体的样式和大小
- VC改变控件的背景颜色 字体 文本颜色
- iOS改变UINavigationBar导航条标题颜色和字体
- IOS_改变UITextField placeHolder颜色、字体
- IOS_改变UITextField placeHolder颜色、字体
- VC 编辑框 改变背景、字体、文本颜色、长度限制、英文 汉字判断收藏
- 在多次改变 RichEdit.Text部份文本的颜色后,出现所有字体都变色的的解决办法
- iphone ios 如何在同一行中显示不同字体,颜色文本(UILabel)
- IOS_改变UITextField placeHolder颜色、字体
- ios开发之改变UIWebView文本字体的样式和大小
- VC 编辑框 改变背景、字体、文本颜色、长度限制
- VC 编辑框 改变背景、字体、文本颜色、长度限制、英文 汉字判断
- IOS_改变UITextField placeHolder颜色、字体
- VC 编辑框 改变背景、字体、文本颜色、长度限制、英文 汉字判断
- VC 编辑框 改变背景、字体、文本颜色、长度限制、英文 汉字判断