如何在鞋子的流槽中实现垂直对齐?

发布于 2024-07-18 17:14:34 字数 452 浏览 6 评论 0原文

flow 槽中的默认垂直对齐方式显然是对元素进行顶部对齐。 这是一个示例:

Shoes.app (:title => "Vertical Alignment", :width => 300, :height => 150) do
  background "#DFA"
  flow :margin => 30 do
    title "BIG"
    tagline "MEDIUM"
    inscription "SMALL"
  end
end

如何让 flow 插槽将其元素居中对齐,而不计算每个元素的 :rise 值? 我本来期望 flow 插槽有垂直对齐样式,而 stack 插槽有水平对齐样式,但我没有看到类似的东西。 我错过了什么?

The default vertical alignment in a flow slot is apparently to top-align the elements. Here's a sample:

Shoes.app (:title => "Vertical Alignment", :width => 300, :height => 150) do
  background "#DFA"
  flow :margin => 30 do
    title "BIG"
    tagline "MEDIUM"
    inscription "SMALL"
  end
end

How do I get the flow slot to center-align its elements short of calculating a :rise value for each element? I would have expected a vertical-alignment style for flow slots and a horizontal-alignment style for stack slots, but I don't see anything like that. What did I miss?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

财迷小姐 2024-07-25 17:14:34

据我所知,没有垂直对齐的样式。 水平对齐在堆栈中很有用:

Shoes.app (:title => "Horizontal Alignment", :width => 300, :height => 150) do
  background "#DFA"
  stack :margin => 30 do
    title "BIG", :align => 'center'
    tagline "MEDIUM", :align => 'center'
    inscription "SMALL", :align => 'center'
  end
end

请记住,Shoes 仍然是一项正在进行中的工作,因此 _why 最终可能会解决它。

To my knowledge, there's no style for vertical alignment. There is horizontal alignment which is useful in stacks:

Shoes.app (:title => "Horizontal Alignment", :width => 300, :height => 150) do
  background "#DFA"
  stack :margin => 30 do
    title "BIG", :align => 'center'
    tagline "MEDIUM", :align => 'center'
    inscription "SMALL", :align => 'center'
  end
end

Keep in mind that Shoes is very much still a work in progress, so _why will probably get around to it eventually.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文