如何让ListView的第一个项目被选定为在启动时默认? [英] How to make the first item of a ListView to be selected as default at startup?

查看:142
本文介绍了如何让ListView的第一个项目被选定为在启动时默认?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有在我的应用程序一个ListView和ListView中有一个选择。我想使这个ListView中的第一项被选中的默认是在应用的非常的启动如何?任何人都可以给一些建议吗? THX了很多。

There is a ListView in my App and the ListView has a selector. I want to make the first item of this ListView to be selected as default at the very startup of App, How? Can anyone give some tips? THX a lot.

推荐答案

您可以通过

yourListView.setSelection(0);
yourListView.getSelectedView().setSelected(true);

我希望这会帮助你。

I hope this will help you

这篇关于如何让ListView的第一个项目被选定为在启动时默认?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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