如何通过编程创建多行UITextfield?
我需要创建一个支持多行的textfield,其中包含多个占位符。我不想引用它的xib文件。
如何通过编程创建多行UITextfield?
我需要创建一个支持多行的textfield,其中包含多个占位符。我不想引用它的xib文件。
你的问题不是很清楚,所以这可能是答案:
UITextView *textView ;
textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 400, 50)] ;
NSString *myMultilineString = [NSString stringWithFormat:@"nanan %d \nline2 %f\nline3 %@", 5, 1.45f, self] ;
textView.text = myMultilineString ;
textView.userInteractionEnabled = NO ;
[self.view addSubview:textView] ;
UITextView
来实现此编程需求。 - Baby Groot