1
这显然是一个极其“不好”的问题。我知道UITextView
有一个Boolean
editable
属性,(因为I'm not entirely illiterate)所以我的问题的答案似乎很直接。但是......使UITextView对象可编辑
我编程方式创建一个UITextView是这样的:
UITextView* input = [[UITextView alloc] initWithFrame: CGRectMake(0, 0, 100, 30)];
input.backgroundColor = [UIColor whiteColor];
input.editable = YES;
input.text = @"Type something here...";
[input setUserInteractionEnabled: YES];
....
[mainView addSubview: input];
但是当我在Xcode运行iPhone模拟器,点击输入字段没有做任何事情。我不能输入任何文字,虚拟键盘不会出现,等等。
那么,我在这里做错了什么?为什么UITextView
对象在Xcode iPhone模拟器中实际上不可编辑?
你看到默认文本了吗? –
这很奇怪......你看到文字和白色的背景? – erdekhayser
是的,我看到默认文本 – Siler