当单击TextInput React本机时,保持键盘打开
我在键盘上有问题,当我单击按钮显示密码时,文本输入变得模糊,然后隐藏键盘。 当按钮点击时,我想保持键盘打开。 我发现了一个解决方法,它与iOS效果很好,但与Android不起作用?这是公共问题吗? 我应该怎么办?
<View>
<TextInput ref={inputRef} secureTextEntry={secure} style={styles.input} {...rest} />
<TouchableWrapper style={styles.secureTextWrapper} onPress={_handleSecureTextEntryChange}>
secure ? 'show' : 'hide'
</TouchableWrapper>
</View>
I have problem with keyboard, when i click the button to show password the TextInput get blur, and hide the keyboard.
i want to keep keyboard open when the button clicks.
i have found a workaround it works well with ios but doesn't work with android? is it a public problem?
what should i do?
<View>
<TextInput ref={inputRef} secureTextEntry={secure} style={styles.input} {...rest} />
<TouchableWrapper style={styles.secureTextWrapper} onPress={_handleSecureTextEntryChange}>
secure ? 'show' : 'hide'
</TouchableWrapper>
</View>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是我完成密码输入的方式,我创建了一个用某些边界代表
TextInput
的容器。在容器内部一个标题和密码范围。passwassContainer:
onsecurePress:
style: style:style:style:
This is how I did my password input, I created a container representing the
TextInput
with some borders. Inside the container a title and passwordContainer.passwordContainer:
onSecurePress:
style: