【问题标题】:Cannot get overflow text in flutter无法在颤动中获取溢出文本
【发布时间】:2022-07-21 16:12:03
【问题描述】:
 Widget commonText(
        {required String text, double? size, FontWeight? fontWeight, Color? color}) {
      return Text(text,
        style: TextStyle(
          fontSize: size,
          color: color ?? const Color(0xFF828282),
          fontWeight: fontWeight ?? FontWeight.bold,
          overflow: TextOverflow.ellipsis
      ),);

我将它与 listTitile 一起使用,用 row 包裹它

【问题讨论】:

  • 尝试将您的文本包裹在 Flexible
  • 那将是哈希大小,因为我使用列表标题和另一个文本,用行包装它

标签: flutter flutter-layout


【解决方案1】:

对于您正在制作的瓷砖,我建议您使用ListTile

ListTile(
  leading: //image,
  title: //rothe chan,
  subtitle: Row(
    children: [
      //icon, 
      Expanded(child: //61dd...),
    ]
  ),
)

【讨论】:

    猜你喜欢
    • 2021-09-28
    • 2021-06-06
    • 2020-06-17
    • 1970-01-01
    • 2021-03-16
    • 2020-05-24
    • 1970-01-01
    • 2022-12-20
    • 2022-01-23
    相关资源
    最近更新 更多