【问题标题】:How to change the text size of a List Tile Widget?如何更改 List Tile Widget 的文本大小?
【发布时间】:2020-06-18 05:49:35
【问题描述】:

我一直在寻找一种方法来更改我的 List Tile Widget 的文本大小,

【问题讨论】:

    标签: android flutter dart


    【解决方案1】:

    您必须将 TextStyle 作为参数传递给 Text 小部件。这是一个例子。

    ListTile(
        leading: FlutterLogo(size: 72.0),
        title: Text('Three-line ListTile'),
        subtitle: Text(
             'A sufficiently long subtitle warrants three lines.',
             style: TextStyle(
                  fontSize: 20.0,
                  color: Colors.red,
                  fontWeight: FontWeight.w600,
             ),
        ),
        trailing: Icon(Icons.more_vert),
        isThreeLine: true,
    ),
    

    您可以从 TextStyle 更改多种样式的 Text 小部件,例如 fontWeigthtextBaseLineletterSpacing 等。

    【讨论】:

    • ,第 5 行文字后遗漏,请更正​​。
    【解决方案2】:

    因为您没有添加任何代码.. 看看这个.. 如果它有任何帮助..

    Text( "Your text", style: TextStyle( fontSize: 20.0, color: Colors.red, fontWeight: FontWeight.w600, ), )

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-15
      • 2021-05-12
      • 1970-01-01
      • 1970-01-01
      • 2011-10-06
      • 2018-01-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多