Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的self.view(风景)的左半边识别一个UITapGesture(在self.view中添加这个手势)有什么办法呢?
我认为最简单的方法是在您的手势识别器处理方法中对此进行测试。因此,当您检测到双击时,有一个条件来测试您的原点(您可以从 reconigzer 的locationInView方法中获得)的X值是否小于视图宽度的一半。如果你知道水龙头在左侧,那么你可以继续。
locationInView
X