How to hide inputAccessoryView without dismissing keyboard

后端 未结 11 1105
挽巷
挽巷 2021-01-02 02:49

I am using a toolbar in the inputAccessoryView property of a textView. When the keyboard shows, it displays the toolbar as expected. When the device is rotated I want to rem

11条回答
  •  醉梦人生
    2021-01-02 03:21

    None of the answers above were working for me and reloadInputViews was causing weird issues. Eventually I got it to show and hide and have touches passthrough by doing:

    Hide it:

    [textview.inputAccessoryView setHidden:YES];
    [textview.inputAccessoryView setUserInteractionEnabled:NO];
    

    Show it:

    [textview.inputAccessoryView setHidden:NO];
    [textview.inputAccessoryView setUserInteractionEnabled:YES];
    

提交回复
热议问题