开发者

shows system menu when user click in each row of a verticalfield manager

My application using a 'vertical field' manager and i add some text to it using a custonField class.The vertical manager constructor is:

scrollingRegion = new VerticalFieldManager(
        USE_ALL_HEIGHT| VERTICAL_SCROLL | VERTICAL_SCROLLBAR|USE_ALL_WIDTH);

I also craete menu using:

protected void makeMenu(Menu menu, int context) {
    menu.add(_imageMenuItem);
    //super.makeMenu(menu, context);
}
class ImageMenuItem extends MenuItem {
    /**
     * Creates a new MenuDemoMenuItem object
     */
    ImageMenuItem() {
        super("Login 开发者_如何学运维Screen", 0, 0);
    }
    public boolean onMenu(int i) {
        return false;
    }

    public void run() {
        UiApplication app = (UiApplication) getApplication();
        app.pushScreen(new LoginScreen());
    }
}

My problem is when I click in the vertical field(which uses a table row manager), the menu is displayed. How can I avoid it? Can any one suggest a solution


if the item is ButtonField you can consume click by define it in the constructor

ButtonField btn = new ButtonField("Login", ButtonField.CONSUME_CLICK);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜