Note that there are some explanatory texts on larger screens.

plurals
  1. POlibgdx scrollpane doesn't display
    primarykey
    data
    text
    <p>I'm having issues getting libgdxs scrollpane control to work. The code below shows control setup for a simple layout with a label, a List of items inside a scrollpane, and a button. The problem is my scroll pane doesn't show anything other than the vScroll/vScrollKnob ninepatch (that tiny white square) it just looks like this:</p> <p><a href="http://i.imgur.com/EJKqgXL.png" rel="nofollow">screenshot</a>.</p> <pre><code> private void setupLayout() { String[] listEntries = {"1","2","3","4","5"}; ListStyle listStyle = new ListStyle(); NinePatch example = new NinePatch(new Texture(Gdx.files.internal("data/example.9.png"))); listStyle.selectedPatch = example; listStyle.font = new BitmapFont(); mList = new List(listEntries,listStyle); ScrollPaneStyle paneStyle = new ScrollPaneStyle(); paneStyle.vScroll = example; paneStyle.vScrollKnob = example; mListScroll = new ScrollPane(mList,paneStyle); mListScroll.setScrollingDisabled(true, false); mListScroll.width = 500; mListScroll.height = 500; LabelStyle ls = new LabelStyle(); ls.font = new BitmapFont(); ls.fontColor = new Color(1.0f, 1.0f, 1.0f, 1.0f); mLabel = new Label("Label", ls); TextButtonStyle buttonStyle = new TextButtonStyle(); buttonStyle.font = new BitmapFont(); mButton = new TextButton("Button",buttonStyle); Table table = new Table(); table.add(mLabel); table.row(); table.add(mButton); table.row(); table.add(mListScroll); mStage.addActor(table); } </code></pre> <p>It works as expected if i don't user the scroll pane and add the list directly to the table like this:</p> <pre><code> Table table = new Table(); table.add(mLabel); table.row(); table.add(mButton); table.row(); table.add(mList); //changed mListScroll(scrollpane class) to mList(List class) mStage.addActor(table); </code></pre> <p><a href="http://imgur.com/lwkCTFp.png" rel="nofollow">screenshot</a></p> <p>But then it will extend out the bottom of my screen when there are too many items. What am I doing wrong here? Is there another parameter i need to set on the scrollpane?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload