本文整理汇总了C#中UIGestureRecognizer.LocationOfTouch方法的典型用法代码示例。如果您正苦于以下问题:C# UIGestureRecognizer.LocationOfTouch方法的具体用法?C# UIGestureRecognizer.LocationOfTouch怎么用?C# UIGestureRecognizer.LocationOfTouch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIGestureRecognizer
的用法示例。
在下文中一共展示了UIGestureRecognizer.LocationOfTouch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransformingGestureDidBeginWithGesture
void TransformingGestureDidBeginWithGesture(UIGestureRecognizer gesture)
{
inFullSizeMode = false;
if (inTransformingState && gesture is UIPinchGestureRecognizer)
{
pinchGesture.Scale = 2.5f;
}
if (inTransformingState)
{
inTransformingState = false;
transformingItem.SwitchToFullSizeMode(false);
CGAffineTransform newTransform = CGAffineTransform.MakeScale(2.5f, 2.5f);
transformingItem.ContentView.Transform = newTransform;
transformingItem.ContentView.Center = transformingItem.FullSizeView.Center;
}
else if (transformingItem==null)
{
PointF locationTouch = gesture.LocationOfTouch(0,this);
int positionTouch = layoutStrategy.ItemPositionFromLocation(locationTouch);
TransformingGestureDidBeginAtPosition(positionTouch);
}
}
示例2: ShouldBegin
public bool ShouldBegin(UIGestureRecognizer gestureRecognizer)
{
bool valid = true;
bool isScrolling = Dragging || Decelerating;
if (gestureRecognizer == tapGesture)
{
if (editing && disableEditOnEmptySpaceTap)
{
PointF locationTouch = tapGesture.LocationInView(this);
int position = layoutStrategy.ItemPositionFromLocation(locationTouch);
valid = (position == GMGV_INVALID_POSITION);
}
else
{
valid = !isScrolling && !editing && !longPressGesture.HasRecognizedValidGesture();
}
}
else if (gestureRecognizer == longPressGesture)
{
valid = (sortingDelegate!=null || enableEditOnLongPress) && !isScrolling && !editing;
}
else if (gestureRecognizer == sortingPanGesture)
{
valid = (sortMovingItem != null && longPressGesture.HasRecognizedValidGesture());
}
else if(gestureRecognizer == rotationGesture || gestureRecognizer == pinchGesture || gestureRecognizer == panGesture)
{
if (transformDelegate != null && gestureRecognizer.NumberOfTouches == 2)
{
PointF locationTouch1 = gestureRecognizer.LocationOfTouch(0,this);
PointF locationTouch2 = gestureRecognizer.LocationOfTouch(1,this);
int positionTouch1 = layoutStrategy.ItemPositionFromLocation(locationTouch1);
int positionTouch2 = layoutStrategy.ItemPositionFromLocation(locationTouch2);
valid = !editing && (IsInTransformingState || ((positionTouch1 == positionTouch2) && (positionTouch1 != GMGV_INVALID_POSITION)));
}
else
{
valid = false;
}
}
return valid;
}