【发布时间】:2016-12-08 05:39:28
【问题描述】:
我想在使用 UIPanGestureRecognizer 移动视图的父视图中移动视图。我正在使用下面的代码。
-(void)move:(UIPanGestureRecognizer *)recognizer {
CGPoint touchLocation = [recognizer locationInView:self.customeView];
self.view.center = touchLocation;
}
我想使用 locationInView 而不是 translationInView 来移动视图。谁能帮助我如何使用 locationInView 在父视图中移动视图?
【问题讨论】:
-
将可拖动视图的坐标从子视图转换为父视图的问题?还是让它动起来?
-
我在使用 translationInView 时遇到问题,因此我使用 locationInView。
标签: ios objective-c