【问题标题】:Having only the bottom border show on a TextFormField using InputDecoration使用 InputDecoration 在 TextFormField 上仅显示底部边框
【发布时间】:2020-04-11 17:40:16
【问题描述】:

我想知道是否可以只在 TextFormField 上显示底部边框,最好使用 InputDecoration 小部件,因为我需要使用一些特定于它的属性(hintText 等)。如果使用 InputDecoration 小部件无法做到这一点,那么我们也非常感谢您提供解决方法。

【问题讨论】:

  • 向我们展示您迄今为止为实现输出所做的工作

标签: flutter


【解决方案1】:
TextFormField(
  decoration: InputDecoration(
    hintText: 'Hint',
    border: UnderlineInputBorder(
      borderSide: BorderSide(
        color: Colors.grey
      )
    )
  ),
);

【讨论】:

  • 请不要只发布代码作为答案,还要解释您的代码的作用以及它如何解决问题的问题。带有解释的答案通常质量更高,更容易吸引投票。
猜你喜欢
  • 2021-08-05
  • 1970-01-01
  • 2020-09-10
  • 1970-01-01
  • 1970-01-01
  • 2020-05-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多