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

请问我想在原生键盘和自定义键盘之间切换,该怎么注册原生键盘呢呢? #11

Open
zkcyhs opened this issue Aug 17, 2018 · 1 comment

Comments

@zkcyhs
Copy link

zkcyhs commented Aug 17, 2018

我使用 this.state来控制使用哪个键盘
this.setState({
keyBoardType: 2,
customKeyboardType: 'testKeyboard',
});

<CustomKeyboard.CustomTextInput
customKeyboardType={this.state.customKeyboardType}
placeholder="testKeyboard"
/>

@lyxia
Copy link
Owner

lyxia commented Jan 30, 2019

你好@zkcyhs,因为

install(findNodeHandle(this.input), newProps.customKeyboardType);
的缘故,暂不支持原生键盘注册,不过现有两种解决方案:
1、修改源码,添加原生键盘类型,然后在原生端的“install”方法中检查type是否是原生类型,如若是的则调用原生的"uninstall"方法即可恢复到原生键盘,这样也是实现了原生键盘的注册。
2、在React Native端直接调用原生react-native-yusha-customKeyboard导出的“uninstall”方法,传入textInput的tag参数,也可切换到原生键盘。

感谢你的项目的关注,欢迎提PR!

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

2 participants