UIImageView
メインビューをタップするたびに動的に作成UIImageView
し、指の動きで作成したものをすべて移動したいです。コードをタッチするたびに動的に作成することに成功しました。
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint pt = [touch locationInView:self.view];
imgView = [[[UIImageView alloc] initWithFrame:CGRectMake(pt.x,pt.y, 100, 100)] autorelease];
imgFilepath = [[NSBundle mainBundle] pathForResource:@"img" ofType:@"png"];
img = [[UIImage alloc] initWithContentsOfFile:imgFilepath];
imgView.tag=i;
[imgView setImage:img];
[img release];
[self.view addSubview:imgView];
}
UIImageView
次に、指の動きによって動的に作成されたものを移動したいと思います。ありがとう。