改变分隔条,基于数组的ListView
2016-05-28 16:18
197 查看
布局文件<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#f00"
android:entries="@array/books"
android:dividerHeight="2px"
android:headerDividersEnabled="false"
>
上面的布局文件定义了一个ListView,并通过android:entries制定了列表数组,通过android:divider改变了列表项之间的分隔条。
2. 数组定义如下:<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="books">
<item>hello world</item>
<item>hello world hello world </item>
<item>hello world hello world hello world </item>
<item>hello world hello world hello world hello world </item>
<item>hello world hello world hello world hello world hello world </item>
</string-array>
</resources>
数组里面定义的item会一一显示出来。
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#f00"
android:entries="@array/books"
android:dividerHeight="2px"
android:headerDividersEnabled="false"
>
上面的布局文件定义了一个ListView,并通过android:entries制定了列表数组,通过android:divider改变了列表项之间的分隔条。
2. 数组定义如下:<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="books">
<item>hello world</item>
<item>hello world hello world </item>
<item>hello world hello world hello world </item>
<item>hello world hello world hello world hello world </item>
<item>hello world hello world hello world hello world hello world </item>
</string-array>
</resources>
数组里面定义的item会一一显示出来。
相关文章推荐
- 用virtualbox安装CentOS 7
- linux系统下开机启动流程
- @深入注解,在Java中设计和使用自己的注解
- 文件异步下载
- android 取消标题,程序意外停止
- 解决 android 输入法弹出输入框被遮挡的问题
- 2016年5月28日(项目任务)
- 错误代码: 1005 Can't create table 'hibernate.bill' (errno: 150)
- 《CSS权威指南》学习记录——颜色和长度单位
- VMware网络配置详解一:三种网络模式简介
- 常用网络命令——ping
- C#实现所有经典排序算法汇总zz
- 1042. 字符统计(20)
- jQuery学习笔记20160528
- 寄存器
- Unity拖影效果
- POSIX && XSI
- C++: 生命游戏(模拟细胞群演化)
- Jenkins常用插件说明(持续更新)
- 《构建之法》第8,9,10章 读后感