android studio中 listview怎么分组
1个回答
展开全部
添加listview"lvwItems"后Edit Column,添加列头
itemView = itemManager.ItemCollection;
从数据源获取数据集合
foreach(Item itm in itemView)
{
ListViewItem lviI = new ListViewItem(itm.ItemName); "%");
itemView = itemManager.ItemCollection;
{
lviI.SubItems.Add(itm.ItemType.ToString());
lviI.SubItems.Add(itm.ItemInput.ToString());
lviI.SubItems.Add(itm.ItemRate.ToString()+
lviI.SubItems.Add(itm.ItemTime.ToString());
lviI.Tag = itm.ItemID;
lvwItems.Items.Add(lviI);
}
遍历数据集合ItemView并获取数据,生成ListViewItem对象Lvil,添加到lvwItems.Items里
(lviI.SubItems.Add(itm.ItemType.ToString());这句就是添加每一列的值,作为subItem)
itemView = itemManager.ItemCollection;
从数据源获取数据集合
foreach(Item itm in itemView)
{
ListViewItem lviI = new ListViewItem(itm.ItemName); "%");
itemView = itemManager.ItemCollection;
{
lviI.SubItems.Add(itm.ItemType.ToString());
lviI.SubItems.Add(itm.ItemInput.ToString());
lviI.SubItems.Add(itm.ItemRate.ToString()+
lviI.SubItems.Add(itm.ItemTime.ToString());
lviI.Tag = itm.ItemID;
lvwItems.Items.Add(lviI);
}
遍历数据集合ItemView并获取数据,生成ListViewItem对象Lvil,添加到lvwItems.Items里
(lviI.SubItems.Add(itm.ItemType.ToString());这句就是添加每一列的值,作为subItem)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询