禁用 Fyne 的 HSplit 调整大小?

huangapple go评论106阅读模式
英文:

Go Fyne Disable HSplit Resize?

问题

如何禁用或防止分割窗格可调整大小?

hSplit := container.NewHSplit(
    hello,
    widget.NewButton("Hi!", func() {
        hello.SetText("Welcome :)")
    }),
)

我正在尝试在标签后面放置NewList小部件。然而,我尝试了很多布局,例如NewVBoxLayout,但根据文档,此布局中的所有元素都将设置为最小高度。因此,列表变得非常小。我无法使用container实现这一点。

我也尝试了NewMaxLayout,但是列表现在与Select Item标签重叠。

英文:

How do I disable or prevent the split pane to be resizable?

hSplit := container.NewHSplit(
	hello,
	widget.NewButton("Hi!", func() {
		hello.SetText("Welcome :)")
	}),
)

禁用 Fyne 的 HSplit 调整大小?

I am trying to have a label followed by the NewList widget.
However, I have tried a bunch of layouts for this e.g NewVBoxLayout but as per the doc, all elements in this will be set to the min height. Hence the list becomes extremely small. I am unable to do this using container.

I have tried NewMaxLayout as well, but the list now overlaps with the Select Item label

答案1

得分: 0

目前不支持分割窗格(split pane)功能,分割窗格是一种用户界面控件,用于支持调整两侧的大小。听起来你想做其他事情。你具体想做什么?如果只是布局的话,可以尝试其他不提供此功能的容器。

英文:

Not at this time - split pane is a user interface control to support resizing either side.
It sounds like you want to do something else.
What are you aiming to do exactly? If it's just laying things out then try other containers which don't offer this feature.

答案2

得分: 0

通常,当你想要一个项目填充空间并让其他项目围绕它排列时,你可以使用边框(Border)。
请注意,容器内部包含具有不同布局的容器是我们构建更复杂排列的方式,就像你上面所示的一样。

英文:

Usually when you want 1 item to fill space and others to arrange around it you’d use Border.
Note that containers inside containers with different layouts is the way we build more complex arrangements such as you illustrate above.

huangapple
  • 本文由 发表于 2022年6月9日 13:36:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/72555170.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定