修改UITextfield的Placeholder字体的颜色
- (void)viewDidLoad
{
[super viewDidLoad];
self.title=@"修改UITextField的placeholder字体颜色";
UITextField *textTF=[[UITextField alloc]initWithFrame:CGRectMake(20,130,300,30)];
textTF.placeholder=@"修改UITextField的placeholder字体颜色";
// // 一种方式
// [textTF setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
// 第二种方式
textTF.attributedPlaceholder=[[NSAttributedString alloc]initWithString:@"修改UITextField的placeholder字体颜色" attributes:@{NSForegroundColorAttributeName:[UIColor redColor]}];
[self.view addSubview:textTF];
}
修改UITextfield的Placeholder字体的颜色的更多相关文章
- swift修改UITextfield的Placeholder字体大小和颜色
第一种方法: self.userNumber.setValue(UIColor.lightGray, forKey: "_placeholderLabel.textColor") ...
- iOS 修改UITextField的placeholder属性的字体颜色(修改UITextField占位符字体的颜色)
只要把原来的placeholder属性改为attributedPlaceholder属性即可 具体代码如下图:
- 改动UITextfield的Placeholder字体的颜色
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/ ...
- 修改WordPress标签云字体大小颜色及标签显示数量
WordPress 自带的标签云是一个很实用的小工具.站长可以通过标签对具有相同关健词的文章进行检索分类,利于访客查找相关文章.WordPress 默认标签云的字体最小为8pt,最大为22pt,标签显 ...
- 修改 input / textarea placeholder 属性的颜色和字体大小
话不多说,直接上代码: input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: #666; fon ...
- 【修改 UITextField 中 placeholder 的顏色】
第一种方法: [textfeild setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"]; ...
- 关于怎么在CSDN中修改代码行中字体的颜色
先吐槽一下自己的心路历程吧,自己现在也是在CSDN中发表了自己好几篇的原创博文,但每一篇博文自己总感觉怪怪的,就是说不出自己哪里有毛病呢,知道今天恍然大悟,原来自己的代码行真心丑的要死,没有呈现出在编 ...
- 修改Input中Placeholder默认提示颜色(兼容)
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: #f00; } input:-moz-pl ...
- 改变placeholder字体的颜色
/* Mozilla Firefox 19+ */ ::-moz-placeholder { color: #f00; } /* IE9+版本 */ input:-ms-input-placehold ...
随机推荐
- .net framework 注册到IIS上
首先要安装好所需的IIS版本和.net framework 各版本,注册方式如下: 1.1:C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_re ...
- java下DataInputStream与DataOutputStream写入数据的同时写入数据类型
package cn.stat.p2.demo; import java.io.DataInputStream; import java.io.DataOutputStream; import jav ...
- C#string与char互转
string s = "asdf"; //字符转char char[] c = s.ToCharArray(); Console.WriteLine(s[]); //char转st ...
- 安卓java设置字体颜色
textView03.setTextColor(this.getResources().getColor(R.color.botomfontColorUnSel));
- WinForm(C#)自定义控件之——RoundButton(圆形按钮)
最近需要做一个圆形的按钮,去CodeProject找了一下,发现有现成的可用,但不能完全满足我的需求.因此自己试着利用WinForm中的自定义组件功能,制作一个圆形按钮.圆形按钮小制作即将开始之前,先 ...
- jQuery自学笔记(五):关于jQuery的遍历
向上遍历 DOM 树 parent() //返回被选元素的直接父元素,该方法只会向上一级对 DOM 树进行遍历. parents() //返回被选元素的所有祖先元素,它一路向上直到文档的根元素 ...
- iOS 7 二维码
维码扫描 2014-06-13 10:20:29| 分类: iOS|举报|字号 订阅 下载LOFTER客户端 // // TCTosweepScan.m // TongCheng ...
- POJ 1755 Triathlon
http://poj.org/problem?id=1755 题意:铁人三项,每个人有自己在每一段的速度,求有没有一种3条路线长度都不为0的设计使得某个人能严格获胜? 我们枚举每个人获胜,得到不等式组 ...
- Codeforces 159D Palindrome pairs
http://codeforces.com/problemset/problem/159/D 题目大意: 给出一个字符串,求取这个字符串中互相不覆盖的两个回文子串的对数. 思路:num[i]代表左端点 ...
- #if defined 的意思?
在读s3c2440a的test程序,其中option.h文件中有段语句为: #define LCD_N35 //#define LCD_L80 //#define LCD_T35 //#define ...