2

我正在开发 Atlas App,我在其中显示可以使用 pdf 文件进行缩放和平移的地图。我为此目的使用vfr 阅读器,它工作正常。我想检测触摸位置,以便选择正确的状态。当视图未使用以下代码缩放和平移时,我得到了正确的坐标:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [touches anyObject]; 

    CGPoint point = [touch locationInView:theScrollView];
}

但是,当我将其缩小并平移时,触摸位置会发生变化,并且我没有选择正确的状态。我将如何获得正确的选定状态?

4

1 回答 1

-1

在调试vfr阅读器类时,我发现我可以在ReaderContentPage类中获得正确的触摸位置。此类在缩放后也给出了正确的触摸位置。您可以在 processingSingleTap 方法中得到要点,如下所示:

- (id)processSingleTap:(UITapGestureRecognizer *)recognizer
{
    CGPoint point = [recognizer locationInView:self];
}

CGPoint 点给出正确的触摸位置。然后使用委托方法获取所需类中的正确坐标。

于 2016-08-12T05:56:25.157 回答