学习笔记——textView的placeHolder简单设定
来源:互联网 发布:男士冬季护肤 知乎 编辑:程序博客网 时间:2024/05/04 19:58
从stackoverflow找到的一个非常不错的textView的placeholder设定,不需要自定义直接设定
核心代码 :
说明:- (BOOL)textViewShouldBeginEditing:(UITextView *)textView{ if ([[textView text] isEqualToString:PLACE_HOLDER_TEXT]) {//PLACE_HOLDER_TEXT是一个nsstring的宏 textView.text = @""; textView.textColor = [UIColor blackColor]; } return YES;}-(BOOL)textViewShouldEndEditing:(UITextView *)textView{ if ([[textView text] length] == 0) { textView.text = PLACE_HOLDER_TEXT; textView.textColor = [UIColor lightGrayColor]; } return YES;}
0 0
- 学习笔记——textView的placeHolder简单设定
- HTML5学习笔记——placeholder属性
- 设置textView的placeholder
- 修改TextView的placeholder
- textView的placeholder的书写
- iOS设置textView的placeholder
- 自定义的TextView,带有placeholder
- placeholder—Jquery插件placeholder的使用方法
- 安卓开发笔记三——对于EditText的一些简单属性设定
- Android学习笔记01——TextView
- 两个简单的自定义控件—下划线TextView,切割textView
- 文本框TextView的学习笔记
- 自定义带占位符Placeholder的textView
- iOS 一、设置textView的placeholder
- 自定义一个具有placeholder效果的textView
- Java6学习笔记41——JAVA程序的个人设定
- 学习笔记——combobox绑定datatable数据源后无法设定初始选项的解决方法
- 鸟哥的linux服务器架设篇学习笔记——CentOS相关网络设定
- linux下安装subversion报错:/usr/local/zlib//lib/libz.a(compress.o): relocation R_X86_64_32 against `.rodat
- 关于python函数的可变参数和关键词参数
- java之七篇:为何java可反编译
- ASD
- 单例模式的几种写法
- 学习笔记——textView的placeHolder简单设定
- Same Tree
- 9.16日废旧产业互联网大会在“石家庄”盛大召开邀请同行参加
- 快速排序
- javascript闭包
- Struts 2 Hello World Annotation Example
- windows 进程堆结构梳理
- redis 五种数据类型的使用场景
- java之八篇:如何看待java中的接口