微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何拉伸条目小部件

如何解决如何拉伸条目小部件

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

我所拥有的:

enter image description here

我想要的东西:

enter image description here

代码

  grid := fyne.NewContainerWithLayout(layout.NewGridLayout(5),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),group,entryBox)
  
  group2 :=  widget.NewVScrollContainer(container1)

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

解决方法

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。