Android学习
来源:互联网 发布:博采网络是什么公司 编辑:程序博客网 时间:2024/05/16 00:45
ListView:
数组不能直接给ListView,需要借助适配器。
android中有很多适配器的实现类,其中最好用的是ArrayAdapter
ArrayAdapter<String>adapter=new ArrayAdapter<String>(MainActivity.this,android.R.layout.simple_list_item_1,data);
ListView listView=(ListView)this.findViewById(R.id.list_view);
listView.setAdapter(adapter);
android.R.layout.simple_list_item_1 一行text
android.R.layout.simple_list_item_2 一行title,一行text
android.R.layout.simple_list_item_single_choice 单选按钮
android.R.layout.simple_list_item_multiple_choice 多选按钮
android.R.layout.simple_list_item_checked checkbox
在Java中,this通常指当前对象,super则指父类的
0 0
- android学习
- Android学习
- android 学习
- Android学习
- android 学习
- 学习android
- android学习
- Android学习
- android学习
- android学习
- android学习
- Android 学习
- 学习Android
- android学习
- Android学习
- Android学习
- Android学习
- android学习
- 两道有趣的fork题
- NSInvocation的基本用法
- 如何将git上的代码迁移到Coding上
- 单片机嵌入式编程的五个注意事项
- python 编程小技巧
- Android学习
- android用shape画虚线
- 164.Basic Calculator II
- 利用hdfs的java api进行文件操作注意事项
- 软件测试之sql注入漏洞
- 01背包
- 第一篇
- 文章标题
- U盘安装centos 7 提示 “Warning: /dev/root does not exist, could not boot” 解决办法