开发者

UIView movement

Which is the best way to move a UIView. I have a custom UIView with some custom things in it, like shadows, labels etc.

Today I'm using, for move this UIView.:

- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    UITouch *touc开发者_Python百科h = [[event allTouches] anyObject];
    if (self.isEditing) {       
        CGPoint location = [touch locationInView:[rootView view]];      
        self.center = location; 
    }
}

Is this the best way to move a UIView? I experience this a bit laggy.


I usually reposition a view using the offset between the touchesBegan location and the touchesMoves location.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜