TouchMoved and wrong screen range? or Bug in iOS?

前端 未结 3 1872
滥情空心
滥情空心 2021-01-28 13:40

I found interesting bug in iOS, but trying to belive that i\'m wrong. You have to do 2 things:

1) Create single-view template for iOS

2) Write small function i

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-28 14:33

    Because the status bar is out of limits of the view. And you gets negative values when you touch on status bar.

    Try this:

    - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 
    {
        UITouch* touch = [touches anyObject];
        CGPoint point = [touch locationInView:[touch window]];
        NSLog(@"%@", NSStringFromCGPoint(point));
    }
    

提交回复
热议问题