【问题标题】:I set the stack to be bottomCenter but it doesn't work我将堆栈设置为 bottomCenter 但它不起作用
【发布时间】:2021-09-17 05:38:15
【问题描述】:

你能帮我解决这个问题吗 beach这个词应该在图片底部的位置,但是没有往下走

【问题讨论】:

  • 嗨。请考虑将代码链接或代码本身添加到您的问题中,而不是发布屏幕截图。它可以帮助其他人找出问题所在。

标签: flutter dart


【解决方案1】:

使用 Stack 的第二个小部件作为 Expanded 小部件而不是 Container 小部件:

Expanded(
child: Align(
alignement: FractionalOffset.bottom,
child: Text(.................)
))

【讨论】:

    【解决方案2】:

    您可以在 Stack children 或更好的选项中切换图像和容器顺序,您可以使用 Positioned() 小部件为包含文本的容器提供特定位置。

    Flutter 开发视频:

    【讨论】:

      猜你喜欢
      • 2015-06-25
      • 1970-01-01
      • 2021-03-19
      • 2015-11-18
      • 2015-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-09
      相关资源
      最近更新 更多