-2
我是iPhone的初學者,我正在開發觸摸事件。我已經把這段代碼,但在觸摸不是在圖像視圖中執行我也使用imageView的scrollview,因此,不應用觸摸事件的原因。如何在圖像視圖中應用觸摸事件
我的代碼是
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
// get touch event
UITouch *touch = [[event allTouches] anyObject];
CGPoint touchLocation = [touch locationInView:self.view];
if ([touch view] == imagedisplay) {
// move the image view
imagedisplay.center = touchLocation;
}
}
但在不執行觸摸事件給出任何建議任何源代碼
你在說什麼? 請使用正確的英文,並正確解釋 – MCKapur