这是移动 UIView 的最佳方式。我有一个自定义的 UIView,里面有一些自定义的东西,比如阴影、标签等。
今天我正在使用,移动这个 UIView.:
- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
if (self.isEditing) {
CGPoint location = [touch locationInView:[rootView view]];
self.center = location;
}
}
这是移动 UIView 的最佳方式吗?我觉得这有点滞后。