【问题标题】:BlackBerry - statusbar overlapping screen黑莓——状态栏重叠屏幕
【发布时间】:2012-03-23 03:25:16
【问题描述】:

我在我的 BlackBerry 应用程序中将状态栏定义为包含 2 个按钮的 Horizo​​ntalFileManager,但是当显示状态栏时,它会与屏幕底部重叠。拖拽屏幕可以看到底部的信息,但一松开,状态栏下又消失了。

我怎样才能避免这种情况?我试过 setPadding()、setBorder()、setExtent(),但没有任何改变。

【问题讨论】:

  • 你用什么来实现你的屏幕? MainScreen 类通过 setStatus(Field status) 提供了一个实现。
  • 我正在使用 MainScreen::setStatus(),它正在工作。除了,当我向下滚动时,我看不到屏幕的底部元素,状态栏正在隐藏它们。
  • 查看此链接:stackoverflow.com/questions/8942225/… 并在此处更改代码: super.sublayout(Display.getWidth(), 150); setExtent(Display.getWidth(), 150);比如.....: super.sublayout(Display.getWidth(), bottomPanel.getHeight()); setExtent(Display.getWidth(), bottomPanel.getHeight());试试这个;然后你就可以得到这样的图片:flickr.com/photos/74795641@N06/6734580553/in/photostream

标签: blackberry overlap horizontalfieldmanager mainscreen


【解决方案1】:

感谢您的建议,但我不想重新实现轮子。

目前的解决方案是这样的:

public class VerticalSpacerField extends VerticalFieldManager {
    private final int preferredHeight;

    public VerticalSpacerField(final int preferredHeight) {
        this.preferredHeight = preferredHeight;
    }

    protected void sublayout(final int maxWidth, final int maxHeight) {
        super.sublayout(maxWidth, maxHeight);
        setExtent(maxWidth, preferredHeight);
    }
}

add(new VerticalSpacerField(statusBar.getPreferredHeight()));

【讨论】:

    猜你喜欢
    • 2011-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-05
    • 1970-01-01
    相关资源
    最近更新 更多