如何使标签文本在浮动中居中

问题描述 投票:0回答:1

我们可以使标签文本居中吗?我尝试使用文本对齐,但是它仅使提示文本和输入文本居中,而不是标签文本居中。这是我的代码:

TextFormField(
  style: TextStyle(
    color: Colors.white,
  ),
  // textAlign: TextAlign.center,
  decoration: InputDecoration(

    hintText: '[email protected]',
    hintStyle: TextStyle(                      
      color: Colors.white,
    ),
    alignLabelWithHint: true,
    labelStyle: TextStyle(
    color: Color(0xff9fe0ff),
    fontSize: 25,
  ),
  border: UnderlineInputBorder(
  borderSide: BorderSide(
  color: Color(0xff9fe0ff),
  ),
),
  labelText: 'Email',
),
),
flutter flutter-layout
1个回答
0
投票

使用默认的TextFormField是不可能的。如您所见,对此存在一个未解决的问题:https://github.com/flutter/flutter/issues/2735

© www.soinside.com 2019 - 2024. All rights reserved.