【问题标题】:Text underline display line above text instead of below文本下划线在文本上方而不是下方显示线
【发布时间】:2021-09-15 22:21:07
【问题描述】:

As 显示给定的图像在对文本应用下划线装饰文本样式后,它在 Flutter 2.2 中显示文本上方而不是下方。

 TextButton(
              onPressed: () {},
              child: Text(
                getLocalValue(context, txtTermsNConditions),
                style: TextStyle(
                    fontSize: 12.sp,
                    fontWeight: fwMedium,
                    color: Color(clrPrimary),
                    decoration: TextDecoration.underline),
              ),
            )

【问题讨论】:

  • 我试过你的代码;它按预期显示。

标签: flutter underline text-decorations flutter2.0 textstyle


【解决方案1】:

这是我使用的字体的问题,使用另一种字体已解决。

【讨论】:

    【解决方案2】:

    您可以使用快捷方式,只需使用 Stack 并将 TextDivider 小部件放入其中,然后根据您的要求给出位置即可。

    【讨论】:

      【解决方案3】:

      style: TextStyle(decoration: TextDecoration.overline) 可以解决问题,请参阅this link 了解更多信息。

      【讨论】:

        猜你喜欢
        • 2013-08-22
        • 2021-05-28
        • 2014-02-24
        • 2013-08-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-01-10
        相关资源
        最近更新 更多