通过运行时来修改我们的UITextField的Placeholder的文字颜色
来源:互联网 发布:超级捕快软件下载 编辑:程序博客网 时间:2024/04/29 23:31
//// HQTextField.m// FunnySister//// Created by hq on 16/4/27.// Copyright © 2016年 hanqing. All rights reserved.//#import "HQTextField.h"#import <objc/runtime.h>@implementation HQTextField//通过运行时获取我们TextField当中的一些隐含属性-(void)awakeFromNib{ // unsigned int count=0;// // //获取所有的属性// Ivar *ivars=class_copyIvarList([UITextField class], &count);// // for (int i=0; i<count; i++) {// // Ivar ivar=ivars[i];// // NSString *attrName=@(ivar_getName(ivar));// // HQLog(@"%@",attrName);// // } // free(ivars); UILabel *label=[self valueForKey:@"_placeholderLabel"]; label.textColor=[UIColor grayColor]; //设置光标的颜色 self.tintColor=[UIColor grayColor];}-(BOOL)becomeFirstResponder{ UILabel *label=[self valueForKey:@"_placeholderLabel"]; label.textColor=self.textColor; return [super becomeFirstResponder];}-(BOOL)resignFirstResponder{ UILabel *label=[self valueForKey:@"_placeholderLabel"]; label.textColor=[UIColor grayColor]; return [super resignFirstResponder];}@end
0 0
- 通过运行时来修改我们的UITextField的Placeholder的文字颜色
- 修改UITextField的placeholder颜色
- 修改UITextField的placeholder颜色
- 修改UITextField的placeholder颜色
- 修改UITextField的placeholder颜色
- 修改UITextField的placeholder颜色
- 修改UITextField的placeholder颜色
- 修改UITextField的placeholder颜色
- iOS利用storyboard修改UITextField的placeholder文字颜色
- iOS利用storyboard修改UITextField的placeholder文字颜色
- iOS利用storyboard修改UITextField的placeholder文字颜色
- 修改UITextfield的Placeholder字体的颜色
- 修改UITextfield的Placeholder字体的颜色
- 修改UITextfield的Placeholder字体的颜色
- 修改UITextfield的Placeholder字体的颜色
- 修改UITextfield的Placeholder字体的颜色
- 修改UITextfield的Placeholder字体的颜色
- 修改UITextfield的Placeholder字体的颜色
- Android:使用webview上传文件(支持相册和拍照) .
- XAMPP和javaweb的数据库的连接中文查询数据不成功的问题
- 从assets中读取xml文件再动态的创建界面
- IOS动画总结-Core Animation
- 农产品电子商务运营应该怎么做?
- 通过运行时来修改我们的UITextField的Placeholder的文字颜色
- 组策略知识
- 微信支付 php 公众平台及移动端服务器
- 电子商务平台支付接口开发原理及流程
- C 存储类型摘要
- 通过测试和代码告诉你Maven是如何使用mirror和repository的---学习笔记
- linux下unix socket通信--基于udp
- Android基础类之BaseAdapter
- 进程和线程学习理解