0
我正在使用touchesBegan:
。iphone touchesbegan
我觸摸一個物體並將其拖放到其他位置,但我也想在其原始位置上覆制一個物體。也就是說,在觸摸和拖動之後,應該在其原始位置上有一個副本。
下面是我的代碼:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch=[[event allTouches]anyObject];
CGPoint location=[touch locationInView:touch.view];
image1.center=location;
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
[self touchesBegan:touches withEvent:event];
}
你的問題到底是什麼?請重新說明它! – LordT 2010-12-06 11:34:59
好吧,我將詳細解釋,我有一個imageview命名爲image1,我添加touchesbegan當我們觸摸image1,我們可以將它移動到屏幕上的任何地方,但我想要的是保留圖像的副本在它的原始位置和另一個副本,我們可以拖動屏幕上的任希望這次我明確表示。 – neha 2010-12-06 12:11:44