iOS开发系列之四 – UITextView 用法小结
// 初始化输入框并设置位置和大小
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(10, 10, 300, 180)];
// 设置预设文本
textView.text = @"";
// 设置文本字体
textView.font = [UIFont fontWithName:@"Arial" size:16.5f];
// 设置文本颜色
textView.textColor = [UIColor colorWithRed:51/255.0f green:51/255.0f blue:51/255.0f alpha:1.0f];
// 设置文本框背景颜色
textView.backgroundColor = [UIColor colorWithRed:254/255.0f green:254/255.0f blue:254/255.0f alpha:1.0f];
// 设置文本对齐方式
textView.textAlignment = NSTextAlignmentLeft;