【问题标题】:Flutter: Keyboard not showing on TextField after hot reloadingFlutter:热重新加载后键盘未显示在 TextField 上
【发布时间】:2019-12-23 06:32:44
【问题描述】:

我不确定为什么热重载后键盘没有显示,我运行了下面的代码,它给出了没有 autofocus: true

的空 TextFiled
 TextField field = new TextField(
      controller: controller,
);

但是在添加 autofocus: true 强文本**之后,键盘应该显示为有状态的小部件将在热重载后重新绘制自己。

 TextField field = new TextField(
          controller: controller,
          autofocus: true,
    );

注意:我当前的屏幕上只有 TextWidget。

【问题讨论】:

    标签: flutter flutter-layout flutter-widget


    【解决方案1】:

    您必须使用热重启重新创建所有小部件,热重启键盘将自动显示。 enter image description here

    mac 上的热重启快捷键:Cmd + Shift + \

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-04-29
      • 2019-09-19
      • 2020-08-04
      • 1970-01-01
      • 2021-02-06
      • 2021-04-07
      • 2022-01-02
      相关资源
      最近更新 更多