我正在尝试使用网格布局,其中第一行是 a GroupWithScroller,第二行是 aContainerWithLayout并且只有两个按钮,quit并且Ok,所以第二行的高度必须很短,但我不知道如何调整任何那些。这是我尝试过的:
a := app.New()
w := a.NewWindow("Title")
var (
quitButton = widget.NewButton("Quit", func() {
a.Quit()
})
okButton = widget.NewButton("Ok", func() {
confirmed = true
a.Quit()
})
)
var (
filesBox = widget.NewGroupWithScroller("Another Title",)
buttonsBox = fyne.NewContainerWithLayout(layout.NewAdaptiveGridLayout(2), quitButton, okButton)
)
for _, file := range files {
var fileCheck = check{
checked: false,
label: filepath.Base(file),
}
storeChecks = append(storeChecks, &fileCheck)
filesBox.Append(widget.NewCheck(fileCheck.label, fileCheck.toggle))
}
w.SetContent(
fyne.NewContainerWithLayout(
layout.NewGridLayoutWithRows(2),
filesBox,
buttonsBox,
),
)
w.Resize(fyne.Size{
Width: 320,
Height: 480,
})
w.ShowAndRun()
但结果窗口似乎将每一行的高度减半:
如何改变第二行的高度?
HUH函数
相关分类