葫芦Android的循环通过一个ListView检查 [英] Calabash Android Looping through a ListView to check

查看:195
本文介绍了葫芦Android的循环通过一个ListView检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用刚开始葫芦和所遇到的一个列表视图。

I've just started using Calabash and have come across a listview.

对于每个列表视图行我要检查一些文本和图像视图的presence。

For each listview row I want to check the presence of some text and image view.

不过我不确定我如何通过列表视图循环?

However I'm unsure how can i loop through the listview?

foreach list_item in listview
   check text label with id
   check image view with id
end

任何帮助将是AP preciated。

Any help would be appreciated.

推荐答案

我不知道在这种情况下使用的foreach,但你可以根据列表中的索引号做。
类似项目获取数,然后通过他们循环招用的两个选项

I am not sure about using foreach in this case, but you could do it based on index number in the list. Something like get count of item, then in a loop move through them by using of of two options

getListView().setSelection(21);

对于平滑滚动:

getListView().smoothScrollToPosition(21);

从这个职位 http://stackoverflow.com/a/7561660/1165581 通过的 HandlerExploit

然后对每个项目检查图像和文字。

And then for each item check the image and text.

这篇关于葫芦Android的循环通过一个ListView检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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