codenameone - 在选项卡下使用 SwipableContainer

标签 codenameone

这会在 Tab 内创建一个 SwipeableContainer,但是 SwipeableContainer 和 Tab 总是会检测到滑动手势(即它在 SwipeableContainer 下显示按钮,并在我的手指从左向右滑动时同时将页面移回左侧选项卡右),这使得按下它后面的按钮变得非常困难。

有没有办法只在 SwipeableContainer 上检测手势?

Tabs main_tab = new Tabs();
Container query_container;
Container history_container;

history_container = new Container(new BoxLayout(BoxLayout.Y_AXIS));

MultiButton his_btn = new MultiButton("History");
Button delete_btn = new Button("delete");
SwipeableContainer  his_list_container = new SwipeableContainer(delete_btn,his_btn);
history_container.add(his_list_container);

main_tab.addTab("query", query_icon, query_container);
main_tab.addTab("history", history_icon, history_container);

最佳答案

我认为您可以使用以下方法删除选项卡的滑动手势:

main_tab_.setSwipeActivated(false);

来自 codenameone 文档:

public void setSwipeActivated(boolean swipeActivated)

Setter method for swipe mode

关于codenameone - 在选项卡下使用 SwipableContainer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40651595/

相关文章:

firebase - 在2020年3月1日之前切换到Play Referrer API-Google Play

codenameone - 代号一 : Controlling the height of the title bar (toolbar)

java - Codename One 主题设计器未启动

java - 代号 1 个 GPS 提供商和当前位置

java - 代号一 - 存储敏感数据

ios - 获取IOS开发构建错误

java - 代号一: "Warning paint queue size exceeded, please watch the amount of repaint calls"

codenameone - 验证器用于与 TextField 和 TextArea 一起使用

codenameone - 代号一号游戏

java - codename1 本地化不起作用