• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UIGestureRecognizer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UIGestureRecognizer的典型用法代码示例。如果您正苦于以下问题:C# UIGestureRecognizer类的具体用法?C# UIGestureRecognizer怎么用?C# UIGestureRecognizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UIGestureRecognizer类属于命名空间,在下文中一共展示了UIGestureRecognizer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: ShouldReceiveTouch

		bool ShouldReceiveTouch (UIGestureRecognizer gestureRecognizer, UITouch touch)
		{
			if (touch.View != View)
				return false;

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


示例17: OnShouldReceiveTouch

		bool OnShouldReceiveTouch(UIGestureRecognizer recognizer, UITouch touch)
		{
			foreach (UIView v in ViewAndSuperviewsOfView(touch.View))
			{
				if (v is UITableView || v is UITableViewCell || v.CanBecomeFirstResponder)
					return false;
			}
			return true;
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:9,代码来源:PageRenderer.cs


示例18: CanBePreventedByGestureRecognizer

		/// <summary>
		/// We want to prevent any other gesture to be recognized on the window!
		/// </summary>
		/// <param name="preventingGestureRecognizer">Preventing gesture recognizer.</param>
		public override bool CanBePreventedByGestureRecognizer (UIGestureRecognizer preventingGestureRecognizer)
		{
			return State != UIGestureRecognizerState.Began;
		}
开发者ID:caseyjb,项目名称:SlidingPanels.Touch,代码行数:8,代码来源:SlidingGestureRecogniser.cs


示例19: Tapped

			static void Tapped(UIGestureRecognizer recognizer)
			{
				var selector = (SelectGestureRecognizer)recognizer;

				var table = (UITableView)recognizer.View;

				if (!selector._lastPath.Equals(table.IndexPathForSelectedRow))
					table.SelectRow(selector._lastPath, false, UITableViewScrollPosition.None);
				table.Source.RowSelected(table, selector._lastPath);
			}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:10,代码来源:ContextActionCell.cs


示例20: OnDoubleTap

 private void OnDoubleTap(UIGestureRecognizer gesture)
 {
     PresentingViewController.DismissViewController(true, null);
 }
开发者ID:cdmedia,项目名称:heinzight,代码行数:4,代码来源:MapViewController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UIGrid类代码示例发布时间:2022-05-24
下一篇:
C# UIFont类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap