[Touches_GestureRecognizers] 8100 bug fix, use View instead of window to handle gestures in landscape mode

This commit is contained in:
olegoid 2013-12-09 22:23:46 +04:00
Родитель b1584b3530
Коммит ba72bc2f07
1 изменённых файлов: 1 добавлений и 3 удалений

Просмотреть файл

@ -36,11 +36,9 @@ namespace Touches_GestureRecognizers
{
public partial class Touches_GestureRecognizersViewController : UIViewController
{
UIWindow window;
public Touches_GestureRecognizersViewController (UIWindow window, string nibName, NSBundle bundle) : base (nibName, bundle)
{
this.window = window;
}
#region Tearing down
@ -170,7 +168,7 @@ namespace Touches_GestureRecognizers
AdjustAnchorPointForGestureRecognizer (gestureRecognizer);
var image = gestureRecognizer.View;
if (gestureRecognizer.State == UIGestureRecognizerState.Began || gestureRecognizer.State == UIGestureRecognizerState.Changed) {
var translation = gestureRecognizer.TranslationInView (window);
var translation = gestureRecognizer.TranslationInView (View);
image.Center = new PointF (image.Center.X + translation.X, image.Center.Y + translation.Y);
// Reset the gesture recognizer's translation to {0, 0} - the next callback will get a delta from the current position.
gestureRecognizer.SetTranslation (PointF.Empty, image);