[英]LibGDX: Fix table background drawable
I have a little problem with the Table. 我的桌子有点问题。 When I execute this: 当我执行此命令时:
toolBar = new Table(Assets.instance.bg_skin);
toolBar.setBackground("bg_table");
toolBar.setFillParent(true);
toolBar.align(Align.top);
I get the added actors align to the topcenter but the background drawable fills the whole screen. 我使添加的actor与顶部中心对齐,但背景可绘制对象充满了整个屏幕。
My goal is to get a toolbar on top 我的目标是在顶部放置一个工具栏
After you add all your actors, try with this: 添加所有演员后,请尝试以下操作:
table.add().expand().fill();
To add an empty cell that will occupy the rest of the screen space. 添加一个将占据屏幕剩余空间的空白单元格。
I guess, but not to sure, you should remove toolBar.align(Align.top);
我猜,但不确定,您应该删除toolBar.align(Align.top);
too. 太。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.