设置 HorizontalPanel 上的对齐方式。外部总重量
我如何实现以下内容:我想创建 HorizontalPanel,然后我想添加 3 个按钮。第一个按钮位于左侧,第二个按钮位于中间,第三个按钮位于末端。我如何设置此按钮的对齐方式?
How I can implement following: I want to create HorizontalPanel, then I want to add 3 buttons. 1st button in left, 2nd in middle and 3rd into end. How I can to set alignment for this buttons?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有几种不同的方法可以实现这一点。这是我发现更有趣的一个:
对第一个和最后一个元素使用 CSS
float: left
和float: right
或使用绝对位置可能是解决这个问题的方法,取决于您希望它如何表现。There are several different ways to accomplish this. Here's one that I found more interesting:
Using CSS
float: left
andfloat: right
for the first and last element or using absolute position is probably the way to go for this, depending on how you want it to behave.