Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

内置键盘与自定义键盘如何进行切换? #88

Open
ddxl123 opened this issue Oct 16, 2022 · 6 comments
Open

内置键盘与自定义键盘如何进行切换? #88

ddxl123 opened this issue Oct 16, 2022 · 6 comments

Comments

@ddxl123
Copy link

ddxl123 commented Oct 16, 2022

No description provided.

@Im-Kevin
Copy link
Owner

这个是已经封装好的,只需要设置正确的InputType就行了

@ddxl123
Copy link
Author

ddxl123 commented Oct 18, 2022

这个是已经封装好的,只需要设置正确的InputType就行了

keyboardType: c.isCustomKeyboard ? CustomKeyboard.inputType : TextInputType.text,

onTap:(){
 isCustomKeyboard = !isCustomKeyboard ;
 setState((){});
}

上面方法无法进行切换呀,始终会保持第一次显示的 keyboardType,
有没有案例?

@Im-Kevin
Copy link
Owner

这个切换需要有unfocus和focus的过程才行,不然这个不会变的

@ZMNOTZ
Copy link

ZMNOTZ commented Dec 8, 2022

image

像图中在自定义键盘里切换系统输入法,有什么办法吗?目前我二次封装了TextField,通过performPrivateCommand方式来通知组件的onAppPrivateCommand方法切换textInputType 做的。

@ZMNOTZ
Copy link

ZMNOTZ commented Dec 8, 2022

这个切换需要有unfocus和focus的过程才行,不然这个不会变的
在自定义键盘里切换系统输入法,有什么办法吗?目前我二次封装了TextField,通过performPrivateCommand方式来通知组件的onAppPrivateCommand方法切换textInputType 做的。

@ddxl123
Copy link
Author

ddxl123 commented Dec 14, 2022

我用unfocus和focus,之间间隔200毫秒的异步延迟就可以了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants