Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configTabLayoutConfig#onSelectItemView 获取索引不对 #52

Closed
scsfwgy opened this issue Dec 6, 2021 · 1 comment
Closed

configTabLayoutConfig#onSelectItemView 获取索引不对 #52

scsfwgy opened this issue Dec 6, 2021 · 1 comment

Comments

@scsfwgy
Copy link

scsfwgy commented Dec 6, 2021

麻烦有时间看一下。在回调里面通过DslTabLayout 获取索引获取的是不对的,但是回调的值 index是对的。
代码如下,获取索引不对:

`
desLayout.configTabLayoutConfig {
onSelectItemView = { _, index, select, _ ->
Log.d("desLayout", "titles2DslTabLayoutChildren: " + select + "," + index)
if (select) {
//这里获取索引不对。
val currentItemIndex =dslLayout .currentItemIndex
}
false
}
}

`

@angcyo
Copy link
Owner

angcyo commented Dec 7, 2021

当需要选中ItemView时, 才会触发此回调.

你可能需要onSelectViewChange回调.

@angcyo angcyo closed this as completed Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants