问题描述
- windows系统的listview实现隔行变色的功能?
- windows系统的listview实现隔行变色的功能?怎么给偶数行增加一个浅色底纹,显得更加醒目?
解决方案
参考这个例子:http://ask.csdn.net/questions/255140
解决方案二:
Android:横行滚动且隔行变色的ListView控件
解决方案三:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Controls;
using System.Windows.Media;
public class ListViewBackgroundConverter :IValueConverter
{
public object Convert(object value Type targetType object parameter CultureInfo culture)
{
ListViewItem item = (ListViewItem)value;
ListView listView =
ItemsControl.ItemsControlFromItemContainer(item) as ListView;
int index = listView.ItemContainerGenerator.IndexFromContainer(item); if (index % 2 == 0) { return Brushes.White; } else { return Brushes.WhiteSmoke; } } public object ConvertBack(object value Type targetType object parameter CultureInfo culture) { throw new NotSupportedException(); }}
解决方案四:
http://blog.csdn.net/wesleyluo/article/details/8569341
时间: 2024-10-30 10:27:11