2017-03-18 76 views
2

如何隐藏/摆脱窗体上的标题栏?如何隐藏/摆脱窗体上的标题栏? Codename One

我试图做到这一点通过创建一个自定义类的形式,并且覆盖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(); 
    } 
} 

由于这是一个醒目网页,所以才有了图象显示的。即。没有标题栏。

回答

4

我假设你正在使用Toolbar全球。您可以通过不添加任何TitleCommand,并通过调用下面(或两者)隐藏标题栏:

splashForm.getToolbar().setUIID("Container"); 

splashForm.getToolbar().hideToolbar(); 
+0

谢谢,它的工作! (为了使它工作,我必须打电话给BOTH。) – ikevin8me