当前位置: 首页>>代码示例>>C#>>正文


C# UIGestureRecognizer类代码示例

本文整理汇总了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);
 }
开发者ID:hhempel,项目名称:StoryboardTables,代码行数:7,代码来源:imageViewCode.cs

示例2: AddGestureRecognizer

        protected void AddGestureRecognizer(UIView target, UIGestureRecognizer tap)
        {
            if (!target.UserInteractionEnabled)
                target.UserInteractionEnabled = true;

            target.AddGestureRecognizer(tap);
        }
开发者ID:MvvmCross,项目名称:MvvmCross,代码行数:7,代码来源:MvxGestureRecognizerBehavior.cs

示例3: OnDoubleTap

 //implement doubletap handler
 private void OnDoubleTap(UIGestureRecognizer gesture)
 {
     if (scrollView.ZoomScale >= 1)
         scrollView.SetZoomScale(0.25f, true);
     else
         scrollView.SetZoomScale(2f, true);
 }
开发者ID:omxeliw,项目名称:recipes,代码行数:8,代码来源:ScrollViewController.cs

示例4: GestureRecognizerShouldBegin

		public override bool GestureRecognizerShouldBegin (UIGestureRecognizer gestureRecognizer)
		{
			if (gestureRecognizer.GetType () == typeof (UIPinchGestureRecognizer) && padTouch != null)
				return false;

			return true;
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:7,代码来源:GameView.cs

示例5: ShouldBegin

 public override bool ShouldBegin(UIGestureRecognizer recognizer)
 {
     if (recognizer == Layout.PanGestureRecognizer)
     {
         return Layout.SelectedItemIndexPath != null;
     }
     return true;
 }
开发者ID:reactiveui-forks,项目名称:VirtualSales,代码行数:8,代码来源:DraggableGestureRecognizerDelegate.cs

示例6: ShouldBegin

 public bool ShouldBegin(UIGestureRecognizer recognizer)
 {
     if (recognizer is UIScreenEdgePanGestureRecognizer &&
         ViewControllers.Length == 1) {
         return false;
     }
     return true;
 }
开发者ID:reyalpsirc,项目名称:NavigationExample,代码行数:8,代码来源:CustomNavigationRenderer.cs

示例7: OnSoloTap

		private void OnSoloTap(UIGestureRecognizer gesture)
		{
			CGPoint touchPoint = new CGPoint (gesture.LocationInView(scrollView));
			if(imageView.Frame.Contains(touchPoint))
			{
				Console.WriteLine ("збс");
			}			
		}
开发者ID:SobDee,项目名称:xmrn_ios_projects,代码行数:8,代码来源:ViewController.cs

示例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;
 }
开发者ID:reactiveui-forks,项目名称:VirtualSales,代码行数:12,代码来源:DraggableGestureRecognizerDelegate.cs

示例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;
		}
开发者ID:jdeksup,项目名称:Mapsui.Net4,代码行数:13,代码来源:GestureDelegate.cs

示例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);
			}
		}	
开发者ID:SobDee,项目名称:xmrn_ios_projects,代码行数:17,代码来源:ViewController.cs

示例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;
			}
开发者ID:nickoo71,项目名称:monotouch-samples,代码行数:19,代码来源:Touches_GestureRecognizersViewController.cs

示例12: CanBePreventedByGestureRecognizer

 public override bool CanBePreventedByGestureRecognizer(UIGestureRecognizer preventingGestureRecognizer)
 {
     return !CancelsTouchesInView;
 }
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:4,代码来源:NodeViewCell.cs

示例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);
			}
		}
开发者ID:colbylwilliams,项目名称:bugtrap,代码行数:29,代码来源:BtOverlayViewController.cs

示例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;
 }
开发者ID:UnifyKit,项目名称:OsmSharp,代码行数:9,代码来源:MapView.cs

示例15: shouldReceiveTouch

 internal bool shouldReceiveTouch(UIGestureRecognizer gesture, UITouch touch)
 {
     if (ShouldReceiveTouch != null)
         return ShouldReceiveTouch(gesture, touch);
     return true;
 }
开发者ID:schmidan,项目名称:FlyoutNavigation,代码行数:6,代码来源:FlyoutNavigationController.cs


注:本文中的UIGestureRecognizer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。