簡體   English   中英

如何在 flutter 中對齊文本 position

[英]How to align the text position in flutter

誰能解釋我如何對齊 flutter 代碼中的文本? 我的 output 看起來凌亂,不好看。

在此處輸入圖像描述

這是 output 的代碼部分

在此處輸入圖像描述

child: new Column(
      mainAxisAlignment: MainAxisAlignment.start, //To align at start
      mainAxisAlignment: MainAxisAlignment.end, //To align at end
      children: [

      ],
    );
)

使用 crossAxisAlignment 和 mainAxisAlignment 來定義孩子的 position...

Column(
  crossAxisAlignment: CrossAxisAlignment.start,
  mainAxisAlignment: MainAxisAlignment.start,

  children: <Widget>[
    Text('We move under cover and we move as one'),
    Text('Through the night, we have one shot to live another day'),
    Text('We cannot let a stray gunshot give us away'),
    Text('We will fight up close, seize the moment and stay in it'),
    Text('It’s either that or meet the business end of a bayonet'),
    Text('The code word is ‘Rochambeau,’ dig me?'),
    
  ],
)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM