问题
im trying to change opacity of first ListView element, but i am not getting the right way to implemet it ; Can you please give some suggestions ?
display.Opacity = 0.5;
foreach (Common trigger in display.Items)
{
if (trigger.Image_Name == "First")
{
trigger.Opacity = 1;
}
}
where display is my ListView
回答1:
When you change the opacity property of ListView it does not affect to it's items separately(opacity changes for ListView as a whole). If you want to set all items opacity to 0.5 except one, try to do something like this
for(int i=1; i<display.Items.Count;i++)
display.Items[i].Opacity = 0.5;
来源:https://stackoverflow.com/questions/17993912/how-can-i-change-opacity-of-first-listview-element