Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin.forms TouchEffect在具有stacklayout的ios中不起作用?_Xamarin.forms - Fatal编程技术网

Xamarin.forms TouchEffect在具有stacklayout的ios中不起作用?

Xamarin.forms TouchEffect在具有stacklayout的ios中不起作用?,xamarin.forms,Xamarin.forms,当我触摸模拟器时,它不工作。为什么?这是插件存在的问题。将以下行添加到iOS项目中的AppDelegate.cs StackLayout stackLayout = new StackLayout() { BackgroundColor = Color.Transparent }; var touchEffect = new TouchTracking.Forms.TouchEffect() { Capture = true

当我触摸模拟器时,它不工作。为什么?

这是插件存在的问题。将以下行添加到iOS项目中的AppDelegate.cs

StackLayout stackLayout = new StackLayout()
        {
            BackgroundColor = Color.Transparent
        };
        var touchEffect = new TouchTracking.Forms.TouchEffect() { Capture = true };
        touchEffect.TouchAction += TouchEffect_TouchAction;
        stackLayout.Effects.Add(touchEffect);
Content=stackLayout;

嗨,这个可以了。还有个问题就是滑雪板在真机中不管用,在模拟器中正常,这个是为什么?这里有一个类似的问题可能会对你有所帮助。你最好用英语描述你的问题,这样更多的人可以理解它并帮助你。
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
  global::Xamarin.Forms.Forms.Init();
  LoadApplication(new App());

  var _ = new TouchTracking.Forms.iOS.TouchEffect();

  return base.FinishedLaunching(app, options);
}