How to hide Toolbar in IQKeyboardManager iOS Swift 3

后端 未结 10 2151
南笙
南笙 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 09:55

    You can set IQKeyboardManager below properties.

    I assume you have enabled the IQKeyboardManager in didFinishLaunch of app delegate like this

        IQKeyboardManager.sharedManager().enable = true
    

    shouldShowTextFieldPlaceholder to false ==> If you want to hide placeholder toolbar section

    shouldHidePreviousNext to false ==> If you want to hide next and prev button and so on.

    You can enable the settings in didFinishLaunch of AppDelegate like this

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
    
        IQKeyboardManager.sharedManager().enable = true
    
        IQKeyboardManager.sharedManager().enableAutoToolbar = false
        IQKeyboardManager.sharedManager().shouldShowTextFieldPlaceholder = false
        IQKeyboardManager.sharedManager().shouldHidePreviousNext = false
    
    
        return true
    }
    

提交回复
热议问题