在 Android Tabview 中捕获选项卡单击事件 [英] Capturing the tab click event in Android Tabview

查看:8
本文介绍了在 Android Tabview 中捕获选项卡单击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 android 应用中有一个带有 3 个标签的标签视图.选项卡都工作正常.

I have a tabview in my android app with 3 tabs. The tabs are all working fine.

现在我想在单击当前活动选项卡的选项卡(顶部)时执行一些额外的逻辑.

Now I want to perform some additional logic when the tab (on the top) of the currently active tab is clicked.

这是一个例子:

在我的一个选项卡中,我为用户提供了一个选项,可以按不同的顺序对事物进行排序.当按下当前活动标签的标签时,我想重置所有这些排序.

In one of my tabs, I provide an option for the user to sort things in different order. When the press the tab of the currently active tab, I want to reset all these sorting.

是否可以在tabview中捕获tab点击事件并执行一些额外的逻辑?

Is it possible to capture the tab click event in tabview and perform some additional logic?

为清楚起见进行了编辑.

Edited for clarity.

推荐答案

如果你一直在寻找解决方案,我可能已经找到了.看看这里:Android TabWidget 检测点击当前标签

If you ares till looking for a solution, I might have found one. Take a look here: Android TabWidget detect click on current tab

这篇关于在 Android Tabview 中捕获选项卡单击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆