开发者

touchesMoved <-- I can only see the y point

Why can I only see the "y" component of nowPoint changing, ["x" compone开发者_StackOverflow中文版nt is always "0"] ??

- (void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *) event {
    [super touchesMoved:touches withEvent:event];

    CGPoint nowPoint = [[touches anyObject] locationInView:self.view];
    CGPoint prevPoint = [[touches anyObject] previousLocationInView:self.view];

    NSLog(@"x %d,   y %d", nowPoint.x, nowPoint.y);
}


NSLog(@"x %d, y %d", nowPoint.x, nowPoint.y);

Change this to...

NSLog(@"x %0.02f,   y %0.02f", nowPoint.x, nowPoint.y);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜