Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/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 如何使用Codename One在滑动选项卡中获取当前选项卡值?_Codenameone - Fatal编程技术网

Codenameone 如何使用Codename One在滑动选项卡中获取当前选项卡值?

Codenameone 如何使用Codename One在滑动选项卡中获取当前选项卡值?,codenameone,Codenameone,我们正在研究代号为“Swipe Tabs”的方法,我们需要当前的选项卡索引值,但是getSelectedIndex()方法提供了以前的选项卡索引值,如何获取当前选项卡索引 public int getSelectedIndex() Returns the currently selected index for this tabbedpane. Returns -1 if there is no currently selected tab. Returns: the index o

我们正在研究代号为“Swipe Tabs”的方法,我们需要当前的选项卡索引值,但是getSelectedIndex()方法提供了以前的选项卡索引值,如何获取当前选项卡索引

public int getSelectedIndex()

Returns the currently selected index for this tabbedpane. Returns -1 if there is no currently selected tab.

Returns:
    the index of the selected tab 
getSelectedIndex()返回当前选项卡索引,其中第一个选项卡的索引为0,第二个选项卡的索引为1,依此类推。
请发布您的代码(如果可能)

我假设您使用了选项卡选择侦听器。请注意,该回调的参数包括两个整数,即新旧选项卡的偏移量。