本文整理汇总了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 ("збс");
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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);
}
示例6: HandleTouch
public void HandleTouch (UIGestureRecognizer gestureRecognizer)
{
CGPoint p = gestureRecognizer.LocationInView (View);
HandleTap (p);
}
示例7: handleTap
partial void handleTap (UIGestureRecognizer recognizer)
{
CGPoint tapPoint = recognizer.LocationInView (previewView);
focus (tapPoint);
expose (tapPoint);
}
示例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);
}
}
示例9: OnFocusAndExposeClicked
void OnFocusAndExposeClicked (UIGestureRecognizer gestureRecognizer)
{
CGPoint devicePoint = ((AVCaptureVideoPreviewLayer)PreviewView.Layer).CaptureDevicePointOfInterestForPoint (gestureRecognizer.LocationInView (gestureRecognizer.View));
SetFocusAndMode (VideoDevice.FocusMode, VideoDevice.ExposureMode, devicePoint, true);
}
示例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 ();
}
}
示例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;
}
}
}
示例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));
}