1.改变searchbar的searchField属性

UITextField *searchField = [searchbar valueForKey:@"searchField"];

if (searchField) {

// 背景色

[searchField setBackgroundColor:[UIColor colorWithRed:0.074 green:0.649 blue:0.524 alpha:1.000]];

// 设置字体颜色 & 占位符 (必须)

searchField.textColor = [UIColor whiteColor];

//        searchField.placeholder = @"placeholder";

// 根据@"_placeholderLabel.textColor" 找到placeholder的字体颜色

[searchField setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];

// 圆角

searchField.layer.cornerRadius = 10.0f;

searchField.layer.masksToBounds = YES;

}

2.改变searchBarde 图标样式

[self.searchBar setImage:[UIImage imageNamed:@""] forSearchBarIcon:UISearchBarIconSearch state:UIControlStateNormal];

46.UISearchBar的placeholder字体颜色和背景颜色的更多相关文章

  1. 使用 JavaScript 中的 document 对象的属性,根据下拉框中选择的属性,更改页面中的字体颜色和背景颜色

    查看本章节 查看作业目录 需求说明: 使用 JavaScript 中的 document 对象的属性,根据下拉框中选择的属性,更改页面中的字体颜色和背景颜色 实现思路: 在页面的 <body&g ...

  2. RadioGroup 的 RadioButton 选择改变字体颜色和背景颜色

    RadioGroup <RadioGroup android:id="@+id/client_charge_radiogroup" android:layout_width= ...

  3. Sublime Text3自定义全部字体大小、字体类型和背景颜色

    一.定义侧栏的背景颜色.字体大小和间距 Sublime Text3的Afterglow主题链接为:https://github.com/YabataDesign/afterglow-theme 1.按 ...

  4. Android RadioGroup的RadioButton 选择改变字体颜色和背景颜色

    RadioGroup <RadioGroup android:id="@+id/client_charge_radiogroup" android:layout_width= ...

  5. Bootstrap-全局样式的文本颜色和背景颜色

    .text-五种颜色   文本颜色.text-info文本浅蓝颜色-提示.text-warning文本黄色-警告颜色.text-success文本绿色-成功颜色.text-primary文本深蓝色-警 ...

  6. c# 设置控件的前景颜色和背景颜色

    AutoSize:设置为false取消自动计算尺寸功能,控件的大小则按照设定的Size来呈现,设置为true自动计算大小 TextAlign:设置对齐方式 // // 摘要: // 用默认的所有者运行 ...

  7. AdvStringGrid 单元格字体颜色、背景颜色

    procedure TForm5.Button1Click(Sender: TObject); var I: Integer; begin AdvStringGrid1.RowCount := ;// ...

  8. JS更改字体颜色、背景颜色

    CSS 颜色十六进制值  http://www.w3school.com.cn/cssref/css_colorsfull.asp CSS background-color 属性 body { bac ...

  9. 字体大小和背景颜色修改--Android Studio

    打开: File/seting/Editor/colors&Fonts/Fonts editor Font处默认的不让修改 所以先点击save as  随便点个名字 然后 size就可以修改了

随机推荐

  1. WdatePicker控件中日期的范围选择

    1.开始日期不能大于结束日期,结束日期只能选择今天之前(不包括今天) <asp:TextBox ID="T_CREATION_DATE_Start" Width=" ...

  2. goto,void,extern,sizeof分析

    goto: 程序的质量与goto出现的次数成反比,禁用 goto的副作用:破环了程序的结构化的顺序执行的过程,它有可能会跳过程序的应该执行的一些步骤. void: 修饰函数返回值和参数 c语言中没有定 ...

  3. TZOJ 2546 Electricity(去掉割点后形成的最大连通图数)

    描述 Blackouts and Dark Nights (also known as ACM++) is a company that provides electricity. The compa ...

  4. ZOJ 1610 Count the Color(线段树区间更新)

    描述Painting some colored segments on a line, some previously painted segments may be covered by some ...

  5. Django的具体操作(二)

    今日内容:用户登录以及分页的实现 views.py # 登录动作 def login_action(request): # 必须继承request if request.method == 'POST ...

  6. eclipse启动出现Could not read metadata for ……

    Could not read metadata for …… E:\workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\ ...

  7. swift - 接入听云监测 - 问题

    1. 正常下载  探针SDK:https://report.tingyun.com/mobile-web/#/onlyHeader/sdkDownload 2.按步骤接入 ,添加库啊,什么的URLSc ...

  8. Day 07 文件的相关操作

    文件初始: 文件的三要素: path:文件的路径 mode:r w r+ w+ a encoding: 编码方式 # 打开一个文件的方法 f1 = open('e:\echo.txt', encodi ...

  9. java_3选择与循环

    1.三种执行顺序(流程控制语句) 在Java中,有三种执行结构,第一种:顺序结构.第二种:循环结构.第三种:选择结构. 2.顺序结构 自上而下,顺序执行. 3.循环结构 (1)while语句 初始化表 ...

  10. Python爬虫项目--爬取某宝男装信息

    本次爬取用到的知识点有: 1. selenium 2. pymysql 3  pyquery 正文 1. 分析目标网站 1. 打开某宝首页, 输入"男装"后点击"搜索&q ...