generator-wpd icon indicating copy to clipboard operation
generator-wpd copied to clipboard

[ios]在移动动画时候,出现被移动元素颤抖的一种原因

Open hite opened this issue 10 years ago • 0 comments

下面这个例子是说在touchmove事件里执行,移动被touch的元素blue piece,同时打印出目前blue piece的位置。

        self.position.text = [NSString stringWithFormat:@"%f", self.bluepiece.center.x];
        [self dispatchMoveBluePieceEvent:[touch view] toPosition:[touch locationInView:self.view]];

正如例子中所述;在循环执行移动的时候会打印出来当前的位置。但是 现在的情况是 这个拖动会颤抖而且表现为不能拖动

原因不明:应该是执行移动操作之后,接着获取这个位置导致,类似 对位置的set操作会被放到事件序列里,和get操作形成 deadlock。

hite avatar Nov 01 '14 09:11 hite