How to hide Toolbar in IQKeyboardManager iOS Swift 3

后端 未结 10 2101
南笙
南笙 2021-01-12 09:35

I\'m using the IQKeyboardManger library to scroll text fields when started typing using the keyboard, but I don\'t want to display the default toolbar from their library. Be

10条回答
  •  说谎
    说谎 (楼主)
    2021-01-12 10:03

    Swift 5, IQKeyboardManager (6.3.0)

    You can call this setup function from your didFinishLaunchingWithOptions in the app delegate:

    private func setupKeyboardManager() {
        IQKeyboardManager.shared().isEnabled = true
        IQKeyboardManager.shared().isEnableAutoToolbar = false
        IQKeyboardManager.shared().shouldShowToolbarPlaceholder = false
        IQKeyboardManager.shared().previousNextDisplayMode = .alwaysHide
    }
    

    Feel free to add any other customisation you need in this method, such as shouldResignOnTouchOutside or similar.

提交回复
热议问题