UITextField – 多行

我正在尝试向我的UITextField添加行(我的代码在下面),但是,当typer到达文本字段的末尾时,它不会转到下一行,而是永远保持同一行!如何让它进入下一行?谢谢.

fldNotes = [[UITextField alloc] initWithFrame:CGRectMake(labelLeft,controlTop+5,320 - (2 * labelLeft),200)];
fldNotes.text = te.notes;
fldNotes.placeholder = [theApp.adb GetHC:@"NotesName"];
fldNotes.clearButtonMode = UITextFieldViewModeWhileEditing;
fldNotes.tag = 100;
fldNotes.borderStyle = UITextBorderStyleRoundedRect;
[fldNotes setReturnKeyType:UIReturnKeyDone];
[fldNotes setEnablesReturnKeyAutomatically:YES];
fldNotes.delegate = self;

[contentView addSubview:fldNotes];

最佳答案 请改用UITextView.这允许多行文本.

点赞