美文网首页
Row的text会自动溢出宽度

Row的text会自动溢出宽度

作者: 晓函 | 来源:发表于2022-01-16 12:28 被阅读0次
    image.png

    只需要在Text外面加上Expanded就行。
    切记层次是Row->Expanded->Text()
    中间如果加入其他组件,如GestureDetector,也会失效。

    Row(
      children:[
        Text('昵称'),
        Expanded(child:Text('文字内容')),
      ]
    )
    

    ps:子回复我最后用TextSpan更加完美的实现了:
    https://www.jianshu.com/p/3eef12e324e3

    相关文章

      网友评论

          本文标题:Row的text会自动溢出宽度

          本文链接:https://www.haomeiwen.com/subject/nksfhrtx.html