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


C# UIGestureRecognizer.LocationInView方法代码示例

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


在下文中一共展示了UIGestureRecognizer.LocationInView方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: AdjustAnchorPointForGestureRecognizer

		// Scale and rotation transforms are applied relative to the layer's anchor point.
		// This method moves a UIGestureRecognizer's view anchor point between the user's fingers
		void AdjustAnchorPointForGestureRecognizer (UIGestureRecognizer gestureRecognizer)
		{
			if (gestureRecognizer.State == UIGestureRecognizerState.Began) {
				var image = gestureRecognizer.View;
				var locationInView = gestureRecognizer.LocationInView (image);
				var locationInSuperview = gestureRecognizer.LocationInView (image.Superview);
				
				image.Layer.AnchorPoint = new PointF (locationInView.X / image.Bounds.Size.Width, locationInView.Y / image.Bounds.Size.Height);
				image.Center = locationInSuperview;
			}
		}
开发者ID:nickoo71,项目名称:monotouch-samples,代码行数:13,代码来源:Touches_GestureRecognizersViewController.cs

示例3: AdjustAnchorPointForGestureRecognizer

		void AdjustAnchorPointForGestureRecognizer (UIGestureRecognizer gestureRecognizer)
		{
			if (gestureRecognizer.State == UIGestureRecognizerState.Began) {
				UIView piece = gestureRecognizer.View;
				PointF locationInView = gestureRecognizer.LocationInView (piece);
				PointF locationInSuperview = gestureRecognizer.LocationInView (piece.Superview);

				piece.Layer.AnchorPoint = new PointF (locationInView.X / piece.Bounds.Size.Width, locationInView.Y / piece.Bounds.Size.Height);			
				piece.Center = locationInSuperview;
			}
		}
开发者ID:TheJaniceTong,项目名称:Judo-Xamarin,代码行数:11,代码来源:SlideUpMenu.cs

示例4: ShouldRecognizeSimultaneously

		public bool ShouldRecognizeSimultaneously (UIGestureRecognizer gestureRecognizer, UIGestureRecognizer otherGestureRecognizer)
		{
			// Allow multiple gesture recognizers to be recognized simultaneously if and only if the touch location is not within the touch threshold.
			if (gestureRecognizer == resizeRegionOfInterestGestureRecognizer) {
				var touchLocation = gestureRecognizer.LocationInView (gestureRecognizer.View);
				var closestCorner = CornerOfRect (RegionOfInterest, touchLocation);
				return closestCorner == ControlCorner.None;
			}

			return false;
		}
开发者ID:xamarin,项目名称:monotouch-samples,代码行数:11,代码来源:PreviewView.cs

示例5: FocusAndExposeTap

		void FocusAndExposeTap (UIGestureRecognizer gestureRecognizer)
		{
			var location = gestureRecognizer.LocationInView (gestureRecognizer.View);
			CGPoint devicePoint = PreviewView.VideoPreviewLayer.CaptureDevicePointOfInterestForPoint (location);
			UpdateDeviceFocus (AVCaptureFocusMode.AutoFocus, AVCaptureExposureMode.AutoExpose, devicePoint, true);
		}
开发者ID:xamarin,项目名称:monotouch-samples,代码行数:6,代码来源:CameraViewController.cs

示例6: HandleTouch

		public void HandleTouch (UIGestureRecognizer gestureRecognizer)
		{
			CGPoint p = gestureRecognizer.LocationInView (View);
			HandleTap (p);
		}
开发者ID:W3SS,项目名称:mac-ios-samples,代码行数:5,代码来源:GameViewController.cs

示例7: handleTap

		partial void handleTap (UIGestureRecognizer recognizer)
		{
			CGPoint tapPoint = recognizer.LocationInView (previewView);
			focus (tapPoint);
			expose (tapPoint);
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:6,代码来源:ReceiveViewController.cs

示例8: doubleTapEvent

        private void doubleTapEvent(UIGestureRecognizer sender)
        {
            // Disable gestures on preview mode
            if (mParent.ShouldDisplayFilledCells)
                return;

            if (sender.NumberOfTouches > 0) {

                PointF touchLocation = sender.LocationInView (this);

                Cell cell = getCellFromViewCoordinates (touchLocation);
                mParent.RemovePath (cell);
            }
        }
开发者ID:valryon,项目名称:pixpuzzle,代码行数:14,代码来源:PathGridView.cs

示例9: OnFocusAndExposeClicked

		void OnFocusAndExposeClicked (UIGestureRecognizer gestureRecognizer)
		{
			CGPoint devicePoint = ((AVCaptureVideoPreviewLayer)PreviewView.Layer).CaptureDevicePointOfInterestForPoint (gestureRecognizer.LocationInView (gestureRecognizer.View));
			SetFocusAndMode (VideoDevice.FocusMode, VideoDevice.ExposureMode, devicePoint, true);
		}
开发者ID:xamarin,项目名称:monotouch-samples,代码行数:5,代码来源:AVCamManualCameraViewController.cs

示例10: HandleTap

        void HandleTap(UIGestureRecognizer gestureRecognize)
        {
            // retrieve the SCNView
            var scnView = (SCNView)View;

            // check what nodes are tapped
            CGPoint p = gestureRecognize.LocationInView (scnView);
            SCNHitTestResult[] hitResults = scnView.HitTest (p, (SCNHitTestOptions)null);

            // check that we clicked on at least one object
            if (hitResults.Length > 0) {
                // retrieved the first clicked object
                SCNHitTestResult result = hitResults[0];

                // get its material
                SCNMaterial material = result.Node.Geometry.FirstMaterial;

                // highlight it
                SCNTransaction.Begin ();
                SCNTransaction.AnimationDuration = 0.5f;

                // on completion - unhighlight
                SCNTransaction.SetCompletionBlock(() => {
                    SCNTransaction.Begin ();
                    SCNTransaction.AnimationDuration = 0.5f;

                    material.Emission.Contents = UIColor.Black;

                    SCNTransaction.Commit ();
                });

                material.Emission.Contents = UIColor.Red;

                SCNTransaction.Commit ();
            }
        }
开发者ID:GouriKumari,项目名称:SubmissionSamples,代码行数:36,代码来源:GameViewController.cs

示例11: EditTagFrame

        void EditTagFrame(UIGestureRecognizer gestureRecognizer)
        {
            Console.WriteLine ("edittagframe triggered");
            if (mylock == false) {
                Console.WriteLine ("mutex aquired");
                mylock = true;
                point = gestureRecognizer.LocationInView (this.blend);
            //			Console.WriteLine ("presspoint:" + point);
            //			PointF center = scrollView.Center;
            //			Console.WriteLine("center:"+scrollView.Center);
            //			float scale = scrollView.ZoomScale;
            //			PointF con = new PointF (scrollView.ContentOffset.X / scale, scrollView.ContentOffset.Y / scale);
            //			PointF con = new PointF (scrollView.ContentOffset.X, scrollView.ContentOffset.Y);
            //			Console.WriteLine ("con:" + con);
            //			PointF guess = new PointF (con.X + point.X, con.Y + point.Y);
            //			Console.WriteLine ("guess:" + guess);

                Rects = new List<RectangleF> ();
                Tags = AppDelegate.dao.GetTagsByGalleryObjectID (go.ID);
                for (int i = 0; i < Tags.Count; i++) {
                    TagUtility tu = new TagUtility (Tags [i]);
                    Rects.Add (tu.FetchAsRectangleF ());
                }
                for (int j = 0; j < Rects.Count; j++) {
                    if (Rects [j].Contains (point)) {
            //						if (finds.Exists (x => x.ID == Tags [j].ID)) {
            //							Console.WriteLine ("pushing:" + Tags [j]);
            //							finds.Remove (Tags [j]);
                        tds = new TagDetailScreen (Tags [j],this);

                        found = true;
            //						tds.backpush += (object sender, BackClickedEventArgs e) => {
            //							Console.WriteLine("mutex released");
            //							mylock = false;
            //						};
                        this.NavigationController.PushViewController(tds, true);
                        //this.NavigationController.PushViewController (tds, false);
                        break;
            //						} else {
            //							Console.WriteLine ("adder:" + Tags [j]);
            //							Console.WriteLine ("finds:" + finds.Count);
            //							finds.Add (Tags [j]);
            //							break;
            //						}
                    }
                }
                if (!found) {
                    Console.WriteLine ("releasing mutex");
                    mylock = false;
                }
            }
        }
开发者ID:Skalar,项目名称:Indexer,代码行数:52,代码来源:EditImageModeController.cs

示例12: MapTapped

        /// <summary>
        /// Gets called when the Map is clicked.
        /// </summary>
        /// <param name="sender">Sender who fired the event.</param>
        private void MapTapped(UIGestureRecognizer sender)
        {
            CGPoint pointInView = sender.LocationInView(this.mapView);
            CLLocationCoordinate2D touchCoordinates = this.mapView.ConvertPoint(pointInView, this.mapView);

            FieldHelper.Instance.MapTappedEvent(new Position(touchCoordinates.Latitude, touchCoordinates.Longitude), ZoomLevel(this.mapView));
        }
开发者ID:MilenPavlov,项目名称:treewatch,代码行数:11,代码来源:FieldMapRenderer.cs


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