0
拖着我已經準備和檢查到GitHub的a simple test case用於拖動定製UIView
:縮放自定義的UIView打破了touchesMoved
它運作良好,並拖動中實現的Tile.m爲:
- (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
{
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInView:self];
CGPoint previous = [touch previousLocationInView:self];
self.frame = CGRectOffset(self.frame,
(location.x - previous.x),
(location.y - previous.y));
}
然而,瓷磚太大,my actual game(我將不得不調整它們的縮放比例,一旦遊戲板在UIScrollView
無論如何放大):
所以我擴展我的自定義UIView
s下降致電
tile.transform = CGAffineTransformMakeScale(.5, .5);
大小的變化,但由於所需的瓷磚突然拖「的兩倍快」:
也許touchesMoved
代碼(一個或多個。上面)應該調整,但我不確定那裏的操作是由什麼打破的?