Text Libgdx对话框不显示文本
我有一个Text Libgdx对话框不显示文本,text,libgdx,dialog,label,Text,Libgdx,Dialog,Label,我有一个对话框,带有标签和文本按钮。text按钮显示正确,但我看不到标签文本。但是,如果标签中的文本较长,则对话框会变大;如果文本较短,则对话框会变小 我使用的代码: Dialog dialog = new Dialog("Warning", uiSkin) { public void result(Object obj) { System.out.println("resul
对话框
,带有标签
和文本按钮
。text按钮
显示正确,但我看不到标签
文本。但是,如果标签中的文本较长,则对话框会变大;如果文本较短,则对话框会变小
我使用的代码:
Dialog dialog = new Dialog("Warning", uiSkin) {
public void result(Object obj) {
System.out.println("result "+obj);
}
};
Label warningLabel = new Label("Invalid data", uiSkin);
dialog.text(warningLabel);
dialog.setMovable(false);
TextButton warningButton = new TextButton("OK", uiSkin, "small");
dialog.button(warningButton);
dialog.key(Keys.ENTER, true);
if(!password.getText().equals(passwordRepeat.getText())){
dialog.show(signupStage);
}
这可能很傻,但对话框和文本的颜色不同吗?看起来它们是相同的颜色。我使用
warningLabel.setColor(color.BLACK)
手动更改了颜色,现在它是可见的。谢谢LOL简单的解决方案总是最好的:)这可能很愚蠢,但对话框和文本的颜色不同吗?看起来它们是相同的颜色。我使用warningLabel.setColor(color.BLACK)
手动更改了颜色,现在它是可见的。谢谢LOL简单的解决方案总是最好的:)