Auto enable/disable scrollbar on viewport
Posted: Wed Jul 04, 2018 10:04 am
Given a viewport on a screen that contains a vbox, where the vbox will have a variable number of items, where the items themselves will be of variable height.
Is there a way to automatically detect whether the child content of the viewport (i.e. the vertical height of the vbox) exceeds the viewport size and automatically enable/disable the vertical scrollbar on the viewport based on this? Visually, I would like to have the scrollbar appear when the viewport is scrollable, but be hidden when it isn't needed.
(Apologies if this is already covered here somewhere - my Google Fu wasn't up to finding it.)
Is there a way to automatically detect whether the child content of the viewport (i.e. the vertical height of the vbox) exceeds the viewport size and automatically enable/disable the vertical scrollbar on the viewport based on this? Visually, I would like to have the scrollbar appear when the viewport is scrollable, but be hidden when it isn't needed.
(Apologies if this is already covered here somewhere - my Google Fu wasn't up to finding it.)