如何隐藏/删除表单上的标题栏?
我尝试通过创建一个自定义的Form类并重写shouldPaintStatusBar()来做到这一点,但它不起作用.
整个代码是:
public class SplashScreenOp {
private Resources theme;
private Form splashForm;
public Form getForm() {
return splashForm;
}
public SplashScreenOp(Resources theme) {
super();
this.theme = theme;
}
public final void show() {
splashForm = new Form(new BorderLayout());
Image splashScreenImage = theme.getImage("splashscreen.png");
ScaleImageLabel scaleImageLabel = new ScaleImageLabel(splashScreenImage);
splashForm.add(BorderLayout.CENTER, scaleImageLabel);
splashForm.show();
}
}
Run Code Online (Sandbox Code Playgroud)
由于这是一个启动页面,因此只应显示图像.即.没有标题栏.
我假设你在Toolbar全球使用.您可以通过不添加任何内容TitleCommand并通过调用以下任何一个(或两者)来隐藏标题栏:
splashForm.getToolbar().setUIID("Container");
Run Code Online (Sandbox Code Playgroud)
:
splashForm.getToolbar().hideToolbar();
Run Code Online (Sandbox Code Playgroud)