UITextField控件是开发中,使用频率比较高的控件了,那么有必要总结一下。 一、UITextField手动编写控件 UITextField *txtAccount = [[UITextField alloc] initWithFrame:CGRectMake(10, 10, 300, 30)]; // 设置委托 [txtAccount setDelegate:self]; // 设置占位符 [txtAccount setPlaceholder:@"账号"]; // 设置文本对齐