Search code examples
libgdxscrollbarscrollpane

Libgdx - scrollbar in scrollpane disappears when widget loses focus


I've created a Window with ScrollPane and ScrollBar using libgdx's Scene2d API. It "nearly" works - what I mean is that I can resize window and ScrollBars are showing when needed, but ScrollBars disappear as soon as window (or ScrollPane) loses focus. Is this by design? I can't find any way to keep them displayed when out of focus.

My build.gradle says the following:

ext {
    appName = 'Test'
    gdxVersion = '1.5.3'
    roboVMVersion = '1.0.0-beta-03'
    box2DLightsVersion = '1.3'
    ashleyVersion = '1.3.1'
    aiVersion = '1.4.0'
}

I'm not using ashley, ai, box2d and I'm not building for iOS, so all entries except for appname and gdxVersion are probably meaningless, but I'm including them just in case they can somehow interfere with Scene2d.


Solution

  • Yes, it is by design, but it's a toggle option. Use scrollPane.setFadeScrollBars(false);.