我已经创建了一个ScrollPane,但是没有滚动条(就像浏览器侧边的滚动条),你需要用鼠标拖动。如何获得滚动条?
ScrollPane.ScrollPaneStyle scrollStyle;
/...
scrollTexture = new Texture(Gdx.files.internal("Scroll9.png"));
scrollNine = new NinePatch(new TextureRegion(scrollTexture,6,6),2,2,2,2);
scrollStyle = new ScrollPane.ScrollPaneStyle();
scrollStyle.vScrollKnob = new NinePatchDrawable(box);
并将样式应用于我的可滚动表格
scroll = new ScrollPane(test, scrollStyle);
Skin skin = new Skin(Gdx.files.internal("data/uiskin.json"));
ScrollPane scrollPane=new ScrollPane(resultsTextArea, skin);
我试过了。现在它可以工作了...
这是未经测试的!
似乎使用以下内容可以为滚动窗格启用滚动条。
boolean enable_x = true;
boolean enable_y = true;
scrollpane.setForceScroll(enable_x,enable_y);