2
我有一个想法来隐藏键盘上的一些键。我使用键盘的确切背景并在键盘上方使用它。如何把UIView放在键盘上方
所以我创建一个TextView并添加accessoryView的
//Create the view
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, -10, 768, 300)];
[view setBackgroundColor:[UIColor greenColor]]
UITextField text = [[UITextField alloc] initWithFrame:CGRectMake(120, 10, 80, 28)];
[text setKeyboardType:UIKeyboardTypeNumbersAndPunctuation];
[text setInputAccessoryView:view];
这确实隐藏键盘,但如果我在这个视图中单击,按钮仍然显示。我尝试使用UIButton,但该按钮无法捕捉点击。而我试试becameFirstResponder
时UIKeyboardDidShowNotification
并没有成功。
任何想法?
我没有找到'userInputEnable',而是找到'userInteractionEnabled'。但是,我使用它并且不起作用。 – Rodrigo