Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Codenameone 在选项卡下使用SwipableContainer_Codenameone - Fatal编程技术网

Codenameone 在选项卡下使用SwipableContainer

Codenameone 在选项卡下使用SwipableContainer,codenameone,Codenameone,这会在选项卡内创建一个SwipeableContainer,但SwipeableContainer和选项卡始终会检测到滑动手势(即,当我的手指从左向右滑动时,它会显示SwipeableContainer下的按钮,并同时将页面移回左选项卡),这使得按下其后面的按钮非常困难 有没有办法只检测SwipeableContainer上的手势 Tabs main_tab = new Tabs(); Container query_container; Container history_container;

这会在选项卡内创建一个SwipeableContainer,但SwipeableContainer和选项卡始终会检测到滑动手势(即,当我的手指从左向右滑动时,它会显示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文档中:

公共无效设置已激活(布尔开关已激活)

滑动模式的设置器方法


我在我的应用程序中使用了setSwipeActivated(false)方法,它确实允许swipeable容器工作。这是正确的答案,您应该通过按下旁边的复选框来接受它