一,效果图. 二,工程图. 三,代码. ViewController.m - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //TextField UITextField *textField=[[UITextField alloc]initWithFrame:CGRectMake(20, 100, 100, 200…
代码: #import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //为textField增加键盘事件 [[NSNotificati…