slider always has default width

走远了吗. 提交于 2019-11-30 17:22:17

I found the solution.
Its inside an table so the width is defined by the table width attibut for the spec. col and row.
So the fix is preaty short.

table.add(volumenSlider).width(600).height(60);

And its 600width and 60 height.



they just added the wiki so its more clear!

UI widgets do not set their own size and position. Instead, the parent widget sets the size and position of each child. Widgets provide a minimum, preferred, and maximum size that the parent can use as hints. Some parent widgets, such as Table, can be given constraints on how to size and position the children. To give a widget a specific size in a layout, the widget's minimum, preferred, and maximum size are left alone and size constraints are set in the parent.

Layout at Wiki

Hope it may helps you to fix some issues too.
Regards

speedSlider.getStyle().knob.setMinHeight(100)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!