iOS 改变Search Bar中Scope Button中文本的颜色和字体
2024-10-21 11:48:58
- (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/
最新文章
- PHPExcel设置数据格式的几种方法
- Android---真机调试时不能识别手机的解决方案
- cocos2d-x创建精灵动画方式汇总
- Qt 串口编程学习1
- 《黄聪:手机移动站SEO优化教程》2、PC端和手机移动端SEO优化区别
- Caused by: java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams
- 【QT相关】Qt Widgets Module
- Express与NodeJs创建服务器的两种方法
- wow.js中各种特效对应的类名
- 201621123040《Java程序设计》第七周学习总结
- A1105. Spiral Matrix
- dubbo系列一:dubbo介绍、dubbo架构、dubbo的官网入门使用demo
- C++开发者都应该使用的10个C++11特性 转
- PHP里面增加写日志功能
- sell 项目 订单详情表 设计 及 创建
- android 转屏 onConfigurationChanged 不会执行的问题
- AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 6. Mathematical Concepts and Methods
- 接口测试3-3Excel格式
- page_address()函数分析--如何通过page取得虚拟地址
- spring aop 理解