【问题标题】:BlackBerry Torch scrolling issue黑莓手电筒滚动问题
【发布时间】:2011-08-03 23:29:40
【问题描述】:

我创建了一个在黑莓粗体上运行良好的应用程序,但是当我在 Torch 上安装它时,屏幕没有滚动.. 我使用了启用垂直滚动的管理器并将其添加到另一个主垂直字段管理器? 有人遇到过这个问题吗??

经理的代码如下

public class TableManager extends Manager {

public int HEIGHT = 0;

public TableManager(int height) {
    super(Manager.USE_ALL_WIDTH|Manager.VERTICAL_SCROLL);
    HEIGHT = height;
}

public int getPreferredWidth() {
    return Constants.width * 90 / 100;
}

public int getPreferredHeight() {
    return HEIGHT;
}

protected void sublayout(int maxWidth, int maxHeight) {     
    int y = 150;
    try{
        int count = getFieldCount();
        for (int i = 0; i < count; i++) {
            Field field = getField(i);
            layoutChild(field, field.getPreferredWidth(), field
                    .getPreferredHeight());
            setPositionChild(field, (Constants.width - field
                    .getPreferredWidth()) >> 1, y);
            y += field.getPreferredHeight();
        }
        setExtent(maxWidth, HEIGHT);

    }catch(Exception e){
        e.printStackTrace();
    }

}

}

【问题讨论】:

    标签: blackberry blackberry-torch


    【解决方案1】:

    尝试将您的 TableManager 添加到不可垂直滚动的主管理器。

    您也可以使用简单的 VerticalFieldManager,其中的任何字段都设置为 FIELD_HCENTER,而不是使用此 TableManager。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-10-24
      • 1970-01-01
      • 2021-11-15
      • 1970-01-01
      • 2021-08-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多