【发布时间】:2014-01-14 05:34:06
【问题描述】:
我在设置填充或类似于演员的东西时遇到了麻烦。想不通办法。我想我可能必须在皮肤中添加一些东西?
我有这个文本字段:
textboxskin = new Skin();
textboxskin.add("textfieldback", new Texture("data/textfieldback.png"));
textboxskin.add("cursor", new Texture("data/cursortextfield.png"));
textboxskin.add("selection", new Texture("data/selection.png"));
textboxskin.add("font", font);
TextFieldStyle textfieldstyle = new TextFieldStyle();
textfieldstyle.background= textboxskin.getDrawable("textfieldback");
textfieldstyle.disabledFontColor=Color.BLACK;
textfieldstyle.font=textboxskin.getFont("font");
textfieldstyle.fontColor=Color.WHITE;
textfieldstyle.cursor=textboxskin.getDrawable("cursor");
textfieldstyle.selection=textboxskin.getDrawable("selection");
textfieldusername = new TextField("username", textfieldstyle);
看起来像这样:
如您所见,左居中看起来很糟糕......
【问题讨论】:
标签: android user-interface padding libgdx textfield