Topic was automatically imported from the old Question2Answer platform.
Asked By
chenjie199234
I want to use the scrollcontainer to contain a texturerect,but i want to hide the scrollbar.
Just hide the scrollbar not disable the scrollbar.
I need to scroll the texture down and up.
How to do this!
I’m not sure if this is the right way to do it, but I’ve achieved this effect in the past by adding a theme to the ScrollContainer, or any GUI node above it in the hierarchy.
Edit the theme, and choose “Add Class Items” from the “Edit Theme” button, choose HScrollBar and/or VScrollBar. Then in the settings for those types, set the various styles to NewStyleBoxEmpty. The scrollbar will no longer be drawn. I’ve put together a simple example of hiding just the HScrollbar, here.
thx got it~
u really solved my problem!
thx very much!
chenjie199234 | 2018-03-05 08:38
I am not sure there is a better way to solve this.
but I’m using the same way as what @pgregory said for a long time.
for anyone who might stumble upon this, I want to add that the easiest way I mange to do this is to edit the rect size of the scrollcontainer and making slightly bigger than the screen so the scrollbar would be on the outside, hence not visible.