2017-03-18 74 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