inputAccessoryView不会被删除

时间:2014-07-02 06:29:33

标签: ios keyboard inputaccessoryview

第一

textView.inputAccessoryView = bar;
[textView becomeFirstResponder];

后:

textView.inputAccessoryView = nil;
[textView reloadInputViews];
[textView resignFirstResponder];
[self.view addSubView:bar];

bar是inputAccessoryView。它不会被添加到self.view中。如何实现呢?

1 个答案:

答案 0 :(得分:0)

请在延迟后添加inputAccessoryView视图,如

textView.inputAccessoryView = nil;
[textView resignFirstResponder];
[self.view performSelector:@selector(addSubview:) withObject:bar afterDelay:1];