我有一个UIView
包含一个UITextView
. UIView
是在UIViewController
.
但是当我触摸UITextView
盒子时,什么也没有发生。键盘不会出现,委托方法也不会响应交互。
代码:
noteText = [[UITextView alloc]initWithFrame:CGRectMake(0, 0, 700, 240)];
noteText.layer.borderColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.2].CGColor;
noteText.layer.borderWidth = 2;
[noteText setEditable:YES];
noteText.userInteractionEnabled = YES;
noteText.returnKeyType = UIReturnKeyDone;
noteText.font = [UIFont fontWithName:@"Calibri" size:16];
noteText.textColor = [UIColor blackColor];
[self addSubview:noteText];
更新 1
我从 UIViewController 中删除了所有其他视图,并且只在 UIViewController 中放置了一个 UITextView,但仍然没有反应。光标或键盘均未出现。