经理中的弹出屏幕滚动问题(黑莓)

时间:2011-01-13 06:42:05

标签: blackberry popup

我正在尝试实现一个弹出屏幕(主要用于EULA屏幕),它有一个Manager(垂直),一个RichTextField和一个Button。我希望eula文本显示在管理器中,只有管理员应该有滚动而不是弹出屏幕和按钮才能在管理器之后添加。

问题:如果RichTextField中的文本很小,那么我可以看到文本和按钮。但是如果Text非常长,那么管理器会滚动一点点,根本无法看到按钮。

以下是我所做的:

class ApplicationEulaScreen extends PopupScreen implements FieldChangeListener
{
    private VerticalFieldManager mainContainer;
    private RichTextField eulaText;
    private ButtonField okButton;

    ApplicationEulaScreen() 
    {
        super(new VerticalFieldManager(VerticalFieldManager.NO_VERTICAL_SCROLL);

        mainContainer = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL | VERTICAL_SCROLLBAR | USE_ALL_HEIGHT);

        eulaText = new RichTextField("Indicates whether network connectivity is possible. "
        +"A network is unavailable when a persistent or semi-persistent condition  prevents  the possibility of connecting to that network. Examples include "
        +"* The device is out of the coverage area for any network of this type. "
        +"* The device is on a network other than the home network (i.e., roaming), and data roaming has been disabled. "
        +"* The device's radio is turned off, e.g., because airplane mode is enabled. ",  RichTextField.READONLY | RichTextField.USE_TEXT_WIDTH);

        okButton = new ButtonField("Ok", ButtonField.FIELD_HCENTER | FOCUSABLE |  ButtonField.CONSUME_CLICK);
        okButton.setChangeListener(this);

        mainContainer.add(eulaText);
        add(okButton);

    }
}

需要帮助。

1 个答案:

答案 0 :(得分:0)

这是因为委托管理器(第一个VerticalFieldManager)不可滚动。它永远不会移动其视口来显示你的ButtonField。

您是否尝试过删除mainContainer并将RichTextField直接添加到弹出屏幕?