在黑莓手机在一个屏幕上两个titile酒吧 [英] Two titile bars on a single screen in BlackBerry

查看:247

我想建立在黑莓的屏幕。在其中应该只有原来的标题栏下第二个标题栏。另外,第二标题栏应该是固定的,它不应该与垂直滚动滚动。

在这个问题上需要一些建议。


解决方案

您可以添加第二个冠军,并在<一原标题栏href=\"http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/container/VerticalFieldManager.html\"相对="nofollow"> VerticalFieldManager 。然后,只需设置 VerticalFieldManager 标题,因为它可以设置任何字段,管理​​< / code>实例作为标题。

检查<一href=\"http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/container/MainScreen.html#setTitle%28net.rim.device.api.ui.Field%29\"相对="nofollow">公共无效的setTitle(场冠军)和下面的例子。

公共类DemoScreen扩展MainScreen {
    公共DemoScreen(){
        超();        // prepare自定义标题
        长风格= NO_VERTICAL_SCROLL | NO_VERTICAL_SCROLLBAR | USE_ALL_WIDTH;
        VerticalFieldManager myTitle =新VerticalFieldManager(样式);        //设置背景颜色。
        myTitle.setBackground(BackgroundFactory.createSolidBackground(Color.GRAY));        //添加任何数字/类型字段
        myTitle.add(新的LabelField("第一线"));
        myTitle.add(新的LabelField("第二行"。));        //设置标题
        的setTitle(myTitle);
    }
}
  • 原文

I am trying to build a screen in BlackBerry. In which there should be a second title bar just below the original title bar. Also the second title bar should be fixed and it should not be scrolled with vertical scroll.

Need some advice on this issue.

解决方案

You can add the second title and the original title bar on a VerticalFieldManager. Then just set that VerticalFieldManager as title, as it's possible to set any Field, Manager instance as title.

Check public void setTitle(Field title) and following example.

public class DemoScreen extends MainScreen {
    public DemoScreen() {
        super();

        // Prepare a Custom Title
        long style = NO_VERTICAL_SCROLL | NO_VERTICAL_SCROLLBAR | USE_ALL_WIDTH;
        VerticalFieldManager myTitle = new VerticalFieldManager(style);

        // Set background color.
        myTitle.setBackground(BackgroundFactory.createSolidBackground(Color.GRAY));

        // Add any numbers/types of field
        myTitle.add(new LabelField("First line."));
        myTitle.add(new LabelField("The second line."));

        // Set the Title
        setTitle(myTitle);
    }
}