TextFormField的Offset / ScrollPosition

时间:2019-04-07 21:57:16

标签: flutter flutter-layout

我正在使用带有FocusNode的SingleChildScrollview中的TextFormField,并且效果很好。

TextFormField(
    focusNode: _focusNode,
    textInputAction: TextInputAction.next,
    onFieldSubmitted: (term) {
      _focusNode.unfocus();
      FocusScope.of(context).requestFocus(_focusNodeNext);
    },
    controller: myController,
    keyboardType: TextInputType.number,
    decoration: InputDecoration(
      border: OutlineInputBorder(),
      hintText: ScopedModelLocalizations().tags,
      labelText: ScopedModelLocalizations().entertags,
      fillColor: Colors.white
    ),
    validator: (value) {
      if (value.isNotEmpty && !isNumeric(trim(value))) {
        return ScopedModelLocalizations().validnumber;
      }
    },
  )

由于InputDecoration,当它成为焦点时,它看起来像这样:

textfield_position

理想情况下,我会这样:

textfield_position wanted

有没有一种方法可以为某个字段甚至整个堆栈调整焦点滚动位置的偏移量?

0 个答案:

没有答案