【问题标题】:How to get the current tab value in swipe tabs using Codename One?如何使用代号一获取滑动选项卡中的当前选项卡值?
【发布时间】:2017-05-12 18:55:29
【问题描述】:

我们正在开发代号 One“滑动标签”,我们需要当前标签索引值,但是 getSelectedIndex() 方法为我们提供了滑动时的前一个标签索引值,我怎样才能获得当前标签索引?

【问题讨论】:

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

标签: codenameone


【解决方案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,依此类推。 请发布您的代码(如果可能)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-22
    • 2013-04-24
    • 2011-05-14
    • 1970-01-01
    • 2014-01-31
    • 2010-09-22
    • 1970-01-01
    相关资源
    最近更新 更多