ListView的一些常用方法:setChoiceMode(),getCheckedItemPositions() 。
来源:互联网 发布:淘宝运动兴奋剂 编辑:程序博客网 时间:2024/06/07 04:51
android控件之ListView(二)
5)不同的呈现模式
我们修改ArrayAdapter的第二个显示的模式。另外可以通过getListView()获取ListView的对象,设置ListView的一些属性,ListView的一些常用方法:setChoiceMode(),getCheckedItemPositions() 。
setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_single_choice,items));
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);//表明有选项,如果不设置,缺省为none,即我们点击后仍无反应setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_multiple_choice,items));
getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); //注意,只要点击就会触发Callback,而不过是的点击后选上还是变为取消。setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_checked,items));
getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
接着依次为上面三种格式。
- ListView的一些常用方法:setChoiceMode(),getCheckedItemPositions() 。
- ListView的一些常用设置
- ListView的一些常用属性
- ListView的一些常用设置
- c#listview常用的方法
- 一些常用的方法
- 一些常用的方法
- 一些常用的方法
- 【转载】ListView的一些常用的用法
- ListView一些常用的style设置
- listView一些常用属性
- android ListView 基本常识一些个数的方法
- ASP常用的一些方法
- MFC常用的一些方法
- 反射常用的一些方法
- 常用的一些js方法
- HttpRequest的一些常用方法
- JButton常用的一些方法
- Linux服务器升级tomcat 二
- N皇后问题(DFS)N皇后问题
- php实现多线程
- Ant打包出现 编码utf-8不可映射字符 的解决办法
- String Format for Double [C#]
- ListView的一些常用方法:setChoiceMode(),getCheckedItemPositions() 。
- git init 与git init --bare
- RGB图像转化为HSI图像
- 算法一些例子
- Contest1002 - HHU ACM 综合训练1 B题 Friendship of Mouse(朴素算法)
- U-BOOT-2016.07移植 (第四篇) 修改代码,从NOR启动
- Linux每天一点变量
- CSS3样式控制input按钮效果
- [Android Memory] 内存分析工具 MAT 的使用