protected override void OnAttached() { View.UserInteractionEnabled = true; UpdateTap(); UpdateTapParameter(); UpdateLongTap(); UpdateLongTapParameter(); TouchGestureCollector.Add(View, OnTouch); }
protected override void OnAttached() { View.UserInteractionEnabled = true; _layer = new UIView { UserInteractionEnabled = false, Opaque = false, Alpha = 0, TranslatesAutoresizingMaskIntoConstraints = false }; UpdateEffectColor(); TouchGestureCollector.Add(View, OnTouch); View.AddSubview(_layer); View.BringSubviewToFront(_layer); _layer.TopAnchor.ConstraintEqualTo(View.TopAnchor).Active = true; _layer.LeftAnchor.ConstraintEqualTo(View.LeftAnchor).Active = true; _layer.BottomAnchor.ConstraintEqualTo(View.BottomAnchor).Active = true; _layer.RightAnchor.ConstraintEqualTo(View.RightAnchor).Active = true; }