首页 > 解决方案 > 只看到组件的一半字母 - cn1

问题描述

我使用了粗体 ttf 字体,它可以工作,但只看到一半的字母。

代码:

public void start() {
    if (current != null) {
        current.show();
        return;
    }

    Label testLabel = new Label("Bold Font Not Working");
    testLabel.setUIID("smallBold");

    Form splashForm = new Form(new BorderLayout());
    splashForm.add(BorderLayout.CENTER, BoxLayout.encloseY(testLabel));
    splashForm.show();

    splashForm.revalidate();
}

未选中、选中和按下样式的主题中的 UIID

在此处输入图像描述

现在的样子

在此处输入图像描述

但是,无需将其包装在 boxlayout 或 flowlayout 中,而是直接将其添加到带有边框布局的表单中即可。PS如果表格在boxlayout中,它不起作用

代码:

public void start() {
    if (current != null) {
        current.show();
        return;
    }

    Label testLabel = new Label("Bold Font Not Working");
    testLabel.setUIID("smallBold");

    Form splashForm = new Form(new BorderLayout());
    splashForm.add(BorderLayout.CENTER, testLabel);// this works
    splashForm.show();

    splashForm.revalidate();
}

标签未包装在其他容器中时的图像

在此处输入图像描述

标签: codenameone

解决方案


推荐阅读