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),
    ),
  ),
),

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM