如何拉伸条目小部件

时间:2020-08-27 11:52:07

标签: go fyne

我对小部件的正确布局有疑问。

我所拥有的: enter image description here

我想要的东西: enter image description here

代码:

  grid := fyne.NewContainerWithLayout(layout.NewGridLayout(5), newSpacer, newSpacer, newSpacer, topRSpace, topC)

  // Group of files and dirs buttons
  fileBox := widget.NewVBox(files...)
  dirBox := widget.NewVBox(dirs...)

  entryDisabled := widget.NewMultiLineEntry()
  entryDisabled.SetText("Disabled")
  entryDisabled.Disable()
  entryBox := widget.NewVBox(entryDisabled)

  group := widget.NewGroup(so.GetPath(),dirBox, fileBox)

  container1 := fyne.NewContainerWithLayout(layout.NewBorderLayout(group, nil, nil, nil), group, entryBox)
  
  group2 :=  widget.NewVScrollContainer(container1)

  container2 := fyne.NewContainerWithLayout(layout.NewBorderLayout(grid, nil, nil, nil), grid, group2)
  mainWindow.SetContent(container2)

1 个答案:

答案 0 :(得分:2)

我知道了。需要删除entryDisabled周围的NewVBox。