How to resize the widgets inside hbox or vbox? #3942
-
|
Hello, The entry/button/list are small in the GUI although I have explicitly set their size (fyne 2.3.0). What did I miss? The snapshot is https://drive.google.com/file/d/1ouXwUTXt4NQa1yXTi-HlBX1lrlAbUQA0/view?usp=drive_link Here is the code: ` import ( func main() { } |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
|
VBox and HBox explicitly pack widgets in to their min size - if you don't want that behaviour then try a different container. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you! I wonder if I can set min size of widgets, like label, entry, list ... ? |
Beta Was this translation helpful? Give feedback.
-
|
Use layout.NewSpacer to divide the size of a widget in a container taking the max space. use the last arg to Border layout to take the whole space or grid layout to divide space equaly. Add a layout into a layout to fine tune the size and pos. don't forget spacer. |
Beta Was this translation helpful? Give feedback.
-
|
I will often put items that need a minimum size inside a scroll container which can be set... This is a bit simplistic, but I have several apps that do not load data until it is requested. |
Beta Was this translation helpful? Give feedback.
-
|
Hi all. I need help. How i can resize text entry for it use all free space ? layout := container.NewHBox(selectBtn, fileEntry, layout.NewSpacer(), uploadBtn, uploadProgress)
|
Beta Was this translation helpful? Give feedback.

VBox and HBox explicitly pack widgets in to their min size - if you don't want that behaviour then try a different container.
"Overriding" the size with Resize will be ignored in a managed container, that is part of the layout code either from the container or your own layout logic for containers without set layout.
https://developer.fyne.io/faq/layout