【发布时间】:2015-11-20 02:01:09
【问题描述】:
我正在使用 xamarin 表单并尝试创建导航菜单。单击单元格时,我需要设置新图像。更换图片时,我有一些闪烁。
我创建图像:
var image = new Image { Source = "Image.png"; }
我将它添加到我的网格中
var profileTapRecognizer = new TapGestureRecognizer();
profileTapRecognizer.Tapped += (sender, e) =>
{
ItemClicked(sender as ITaggedCell);
};
image.GestureRecognizers.Add(profileTapRecognizer);
grid.Children.Add(image, i, 0);
在 ItemClicked 中,我更改源并在设置新图像之前闪烁:
image.Source = "NewImage.png"
我试过了
image.BatchBegin()
image.Source = "NewImage.png"
image.BatchCommit()
这样How to change Image Source while clicking on the ListView in xamarin.forms?
改变图像的最佳方法是什么?
【问题讨论】:
标签: c# android xamarin xamarin.forms