一. 修改占位字符串的 颜色:=======方法一 ======================================#import "ViewController.h"#import "MyTextField.h"@interf ...
一. 修改占位字符串的 颜色:
=======方法一 ======================================
#import "ViewController.h"@interface ViewController ()@implementation ViewController- (void)viewDidLoad {- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event@end
运行效果:
1. 没有进入编辑状态效果(textF.leftView = btn;隐藏):
2. 进入编辑状态效果(textF.leftView = btn;出现):
#import "ViewController.h"@interface ViewController ()@implementation ViewController- (void)viewDidLoad { MyTextField *textF = [[MyTextField alloc] initWithFrame:CGRectMake(100, 100, 200, 40)];- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event@end
运行效果:
原标题:UITextFeild的用法
关键词:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。