Android的:从列表视图行位置 [英] Android: Get row position from list view

查看:115
本文介绍了Android的:从列表视图行位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的ListView。每一行都有TextView的一些文字。而且在默认情况下每一行都有它的位置(int值)。我可以通过文本是在文本视图中得到行的位置?

I have ListView. Every row has TextView with some text. And also by default every row has it's position (int value). Can I get row position by text which is in Text View ?

推荐答案

如果您注册以接收click事件,则位置会与事件。如果你需要找到click事件的范围之外的位置,然后将其存储通过setTag()视图中的位置。

If you register to receive click events, then the position will come with the event. If you need to find the position outside the scope of click events, then store the position with the view via setTag().

这篇关于Android的:从列表视图行位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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