Flutter单击TextField时如何始终隐藏键盘但保持焦点(保持显示光标) [英] Flutter How to always hide keyboard when click on TextField but keep focus(Keep show cursor)

查看:19
本文介绍了Flutter单击TextField时如何始终隐藏键盘但保持焦点(保持显示光标)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法控制键盘的显示或隐藏,在我的项目中,我需要始终隐藏键盘但保持专注以显示我的自定义键盘(一个小部件).

I can't control keyboard show or hide, In my project I need to always hide keyboard but keep focused to display my custom keyboard(a widget).

这就是我想要的

这是我的问题

推荐答案

要隐藏键盘并保持光标可见,请将 readOnly 设置为 trueshowCursortrue.

To hide keyboard and keep the cursor visible, set readOnly to true and showCursor to true.

TextFormField(
  showCursor: true,
  readOnly: true),

参见 flutter/issues/#16863

这篇关于Flutter单击TextField时如何始终隐藏键盘但保持焦点(保持显示光标)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆