flutter Text 换行问题

Text(
  S.current.task_detail_task_details + data.text,
  maxLines: 20,
  style: TextStyle(
    color: Color.fromRGBO(77, 99, 104, 1),
  ),
),
直接设置maxLines 发现有些场景会无效,解决方法 使用Expanded,如下:
Expanded(
  child: Text(
    S.current.task_detail_task_details + data.text,
    maxLines: 100,
    style: TextStyle(
      color: Color.fromRGBO(77, 99, 104, 1),
    ),
  ),
),

猜你喜欢

转载自www.cnblogs.com/lulushen/p/12967346.html