我创建了2D项目。和功能 OnMouseDown(),OnMouseDrag(),OnMouseUp()不起作用。
StackLayout sl1 = this.FindByName<StackLayout>("myStackLayout");
sl1.GestureRecognizers.Add(
new TapGestureRecognizer()
{
Command = new Command(async () =>
{
sl1.BackgroundColor = Color.FromHex("#CCCCCC");
await Task.Run(async () => {
await Task.Delay(100);
Device.BeginInvokeOnMainThread(() => {
sl1.BackgroundColor = Color.FromHex("#EEEEEE");
});
});
})
});