如何隐藏/摆脱表单上的标题栏?代号一 [英] How do I hide/get rid the title bar on a Form? Codename One

查看:71
本文介绍了如何隐藏/摆脱表单上的标题栏?代号一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How do I hide/get rid the title bar on a Form?

我试图通过创建一个自定义的Form类并覆盖shouldPaintStatusBar()来做到这一点,但是

I tried to do that by created a custom class of Form and override shouldPaintStatusBar() but it didn't work.

整个代码是:

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();
    }
}

由于这是初始页面,因此仅图像应该显示。即。没有标题栏。

As this is a splash page, so only the image should be displayed. ie. No title bar.

推荐答案

我假设您正在全局使用工具栏。您可以隐藏标题栏,方法是不添加任何 TitleCommand 并调用以下任何一个(或两个):

I assume you are using Toolbar globally. You can hide title bar by not adding any TitleCommand and by calling either of below (or both):

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

splashForm.getToolbar().hideToolbar();

这篇关于如何隐藏/摆脱表单上的标题栏?代号一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆