ios remote keyboard window

怎甘沉沦 提交于 2019-12-13 21:18:32

问题


In iOS 9, I see a new window appearing in my app that I didn't see before. An image is below. From walking the view tree, I suspect it may be coming from the UIRemoteKeyboardWindow -- but I don't know that. What is it, and what do I have to do to keep it from appearing?

EDIT: As a commenter pointed out, this is tied to the inputView, i.e. the keyboard. I don't want a keyboard and so disabled it by calling

    self.inputView = [[UIView alloc]initWithFrame: CGRectZero];

That did kill the keyboard, but there is still the accessory. I've tried similar tricks to kill the accessory; none of them have worked, yet. Calling self.inputAccessoryView is returning nil, which doesn't help.


回答1:


This got rid of it:

-(void) killAccessory {
    UIView* input = self.inputView;
    UIView* parent = input.superview;
    parent.hidden = YES;
}

-(BOOL) becomeFirstResponder {
    BOOL r = [super becomeFirstResponder];
    [self killAccessory];
    return r;
}



回答2:


You can use the following code :

textField.inputAssistantItem.leadingBarButtonGroups = [[NSArray alloc] init];
textField.inputAssistantItem.trailingBarButtonGroups = [[NSArray alloc] init];

the textField use above is the textField which you tap to edit.



来源:https://stackoverflow.com/questions/32932470/ios-remote-keyboard-window

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!