IQKeyboardManager –启用拆分视图时错误的键盘布局

时间:2018-07-13 12:58:56

标签: ios swift iqkeyboardmanager

启用键盘拆分模式后,我使用IQKeyboardManager遇到了一个奇怪的问题。
键盘的背景不是透明的:

enter image description here

但是当不使用IQKeyboardManager时,键盘的背景是透明的:

enter image description here

编辑:如何复制:

//AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    ...
    IQKeyboardManager.shared.enable = true
    ...
}

//ViewController.swift
override func viewDidLoad() {
    ...
    textField.keyboardDistanceFromTextField = 140 // or any constant
    ...
}

有什么建议吗?谢谢!

1 个答案:

答案 0 :(得分:1)

我从IQKeyboardManager库的维护者(answer)得到了一个答案。 如果禁用autoToolbar,则键盘的背景是完全透明的:

IQKeyboardManager.shared.enableAutoToolbar = false