Closed YQcharlse closed 2 years ago
动态Gone Item
之后, 请调用com.angcyo.tablayout.DslTabLayout#updateTabLayout
方法
这样的话item索引也是会改变, 我想要的是item占位在索引上,索引不改变 这样的情况应该怎么做呢
view.setTag
自行保存
嗯嗯好的那我知道了谢谢
老哥,是否可以设置选中的view
setCurrentItem
我的意思是直接指定view
通过View
查找对应的Index
, 然后setCurrenItem
老哥怎么查找呀,没有找到方法呀
getChildAt()
哥,没明白呀,这个方法不是通过 index 查找 view吗?
tabLayout.forEachIndexed { index, view ->
if (view == xxx) {
return index
}
}
哦哦谢谢老哥麻烦了,太感谢了
先是添加了所有item,然后动态的隐藏 GONE个别 item ,这时 item 的索引就会改变 怎样在点击事件时获取 之前没有隐藏时的 索引