本文整理汇总了C#中UIGestureRecognizer类的典型用法代码示例。如果您正苦于以下问题:C# UIGestureRecognizer类的具体用法?C# UIGestureRecognizer怎么用?C# UIGestureRecognizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIGestureRecognizer类属于命名空间,在下文中一共展示了UIGestureRecognizer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDoubleTap
public void OnDoubleTap(UIGestureRecognizer sender)
{
if (scrollView.ZoomScale >= 1)
scrollView.SetZoomScale(0.25f, true);
else
scrollView.SetZoomScale(2f, true);
}
示例2: AddGestureRecognizer
protected void AddGestureRecognizer(UIView target, UIGestureRecognizer tap)
{
if (!target.UserInteractionEnabled)
target.UserInteractionEnabled = true;
target.AddGestureRecognizer(tap);
}
示例3: OnDoubleTap
//implement doubletap handler
private void OnDoubleTap(UIGestureRecognizer gesture)
{
if (scrollView.ZoomScale >= 1)
scrollView.SetZoomScale(0.25f, true);
else
scrollView.SetZoomScale(2f, true);
}
示例4: GestureRecognizerShouldBegin
public override bool GestureRecognizerShouldBegin (UIGestureRecognizer gestureRecognizer)
{
if (gestureRecognizer.GetType () == typeof (UIPinchGestureRecognizer) && padTouch != null)
return false;
return true;
}
示例5: ShouldBegin
public override bool ShouldBegin(UIGestureRecognizer recognizer)
{
if (recognizer == Layout.PanGestureRecognizer)
{
return Layout.SelectedItemIndexPath != null;
}
return true;
}
示例6: ShouldBegin
public bool ShouldBegin(UIGestureRecognizer recognizer)
{
if (recognizer is UIScreenEdgePanGestureRecognizer &&
ViewControllers.Length == 1) {
return false;
}
return true;
}
示例7: OnSoloTap
private void OnSoloTap(UIGestureRecognizer gesture)
{
CGPoint touchPoint = new CGPoint (gesture.LocationInView(scrollView));
if(imageView.Frame.Contains(touchPoint))
{
Console.WriteLine ("збс");
}
}
示例8: ShouldRecognizeSimultaneously
public override bool ShouldRecognizeSimultaneously(UIGestureRecognizer gestureRecognizer, UIGestureRecognizer otherGestureRecognizer)
{
if (gestureRecognizer == Layout.LongPressGestureRecognizer)
{
return Layout.PanGestureRecognizer == otherGestureRecognizer;
}
if (gestureRecognizer == Layout.PanGestureRecognizer)
{
return Layout.LongPressGestureRecognizer == otherGestureRecognizer;
}
return false;
}
示例9: ShouldRecognizeSimultaneously
// Ensure that the pinch, pan and rotate gestures are all recognized simultaneously
public override bool ShouldRecognizeSimultaneously (UIGestureRecognizer gestureRecognizer, UIGestureRecognizer otherGestureRecognizer)
{
// if the gesture recognizers views differ, don't recognize
if (gestureRecognizer.View != otherGestureRecognizer.View)
return false;
// if either of the gesture recognizers is a long press, don't recognize
if (gestureRecognizer is UILongPressGestureRecognizer || otherGestureRecognizer is UILongPressGestureRecognizer)
return false;
return true;
}
示例10: OnDoubleTap
//implement doubletap handler
private void OnDoubleTap (UIGestureRecognizer gesture)
{
/* TouchesBegan += (NSSet touches, UIEvent evt) => {
Console.WriteLine ("TouchesBegan works");
base.TouchesBegan (touches, evt);
}; */
if (scrollView.ZoomScale >= 1)
{
scrollView.SetZoomScale(0.25f, true);
}
else
{
scrollView.SetZoomScale(2f, true);
}
}
示例11: ShouldRecognizeSimultaneously
// Ensure that the pinch, pan and rotate gestures are all recognized simultaneously
public override bool ShouldRecognizeSimultaneously (UIGestureRecognizer gestureRecognizer, UIGestureRecognizer otherGestureRecognizer)
{
// if the gesture recognizers's view isn't one of our images don't recognize
if (gestureRecognizer.View != controller.firstImage &&
gestureRecognizer.View != controller.secondImage &&
gestureRecognizer.View != controller.thirdImage)
return false;
// if the gesture recognizers views differ, don't recognize
if (gestureRecognizer.View != otherGestureRecognizer.View)
return false;
// if either of the gesture recognizers is a long press, don't recognize
if (gestureRecognizer is UILongPressGestureRecognizer || otherGestureRecognizer is UILongPressGestureRecognizer)
return false;
return true;
}
示例12: CanBePreventedByGestureRecognizer
public override bool CanBePreventedByGestureRecognizer(UIGestureRecognizer preventingGestureRecognizer)
{
return !CancelsTouchesInView;
}
示例13: HandleTapGestureAsync
async void HandleTapGestureAsync (UIGestureRecognizer tap)
{
if (tap.State == UIGestureRecognizerState.Recognized) {
UIImage image;
UIGraphics.BeginImageContextWithOptions(UIScreen.MainScreen.Bounds.Size, true, 0);
UIApplication.SharedApplication.Windows[0].DrawViewHierarchy(UIScreen.MainScreen.Bounds, false);
image = UIGraphics.GetImageFromCurrentImageContext();
UIGraphics.EndImageContext();
// image.SaveToPhotosAlbum((i, e) => {
//
// });
await TrapState.Shared.AddSnapshotImageForSdk(image);
// BugTrapState.SnapshotImage = image;
var storyboard = UIStoryboard.FromName("bugTrapKit", NibBundle);
var navController = storyboard.Instantiate<BtAnnotateImageNavigationController>();
PresentViewController(navController, false, null);
}
}
示例14: GestureRecognizerShouldBegin
/// <summary>
/// Gestures the recognizer should begin.
/// </summary>
/// <returns><c>true</c>, if recognizer should begin was gestured, <c>false</c> otherwise.</returns>
/// <param name="gestureRecognizer">Gesture recognizer.</param>
public override bool GestureRecognizerShouldBegin(UIGestureRecognizer gestureRecognizer)
{
return true;
}
示例15: shouldReceiveTouch
internal bool shouldReceiveTouch(UIGestureRecognizer gesture, UITouch touch)
{
if (ShouldReceiveTouch != null)
return ShouldReceiveTouch(gesture, touch);
return true;
}