如何在Codename One中更改SpanLabel的字体?

use*_*619 3 codenameone

为什么我不能设置Codename One的SpanLabel的字体?

SpanLabel title = new SpanLabel("SpanLabel");
title.getAllStyles().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_LARGE));
Run Code Online (Sandbox Code Playgroud)

不行.

小智 5

SpanLabel title = new SpanLabel("SpanLabel");
        **title.getTextAllStyles()**.setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_LARGE));
Run Code Online (Sandbox Code Playgroud)

要更改spanlabel样式,应调用getTextAllStyle方法,如上面的代码所示