【问题标题】:On row one widget align left and another align right在行上,一个小部件左对齐,另一个小部件右对齐
【发布时间】:2020-03-23 11:33:59
【问题描述】:

安卓工作室 3.6

我需要小部件文本位于行首。而上升按钮位于行尾。 我试试这个,但没有帮助

new Container(
                      margin: const EdgeInsets.only(
                          top: Constants.DEFAULT_MARGIN / 2,
                          right: Constants.DEFAULT_MARGIN / 2),
                      height: Constants.MIN_HEIGHT,
                      child: new Row(children: [
                        new Text("Forgot password?",
                            style: TextStyle(
                                color: new Color(Constants.COLOR_PRIMARY))),
                        new Align(
                            alignment: Alignment.centerRight,
                            child: new RaisedButton(
                                child: Text('Sign in'.toUpperCase()),
                                color: new Color(Constants.COLOR_PRIMARY),
                                textColor: new Color(
                                    Constants.COLOR_PRIMARY_TEXT_COLOR),
                                onPressed: () {}))
                      ]))

这里的结果:

为什么Alignment.centerRight 没有帮助

【问题讨论】:

    标签: android flutter


    【解决方案1】:

    在你的行添加

    mainAxisAlignment: MainAxisAlignment.spaceBetween
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-13
      • 1970-01-01
      • 2021-03-13
      • 1970-01-01
      • 2021-12-09
      • 1970-01-01
      • 2021-09-14
      • 2011-04-14
      相关资源
      最近更新 更多