我想根據使用這種方法的XPOS和yPos在視圖中,以獲得UIImageView
(或任何我):如何根據X,Y得到的對象中的視圖(touchesMoved)
- (void) touchesMoved: (NSSet *)touches withEvent:(UIEvent *)event {
CGPoint tappedPt = [[touches anyObject] locationInView:viewIndex];
int xPos = tappedPt.x;
int yPos = tappedPt.y;
NSLog(@"xPos %i yPos %i ", xPos, yPos);
// do something with xPos and yPos like add them to an array
}
非常感謝 !
您是否想要根據這些觸點移動某些視圖? – tipycalFlow 2012-07-24 07:52:29
nop我會想知道,每次我移動手指,(所以我得到的X和Y),如果有uiimageview或沒有,如果有一個uiimageview我得到它,並調整它。 – xGoPox 2012-07-24 08:10:09