首页 文章

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

提问于
浏览
1

我们正在开发Codename One“Swipe Tabs”,我们需要当前的tab索引值,但方法getSelectedIndex()给我们刷卡上的前一个tab索引值,我如何获得当前的tab索引?

1 回答

  • 1
    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,依此类推 . 请发布您的代码(如果可能)

相关问题