私はアプリケーションを開発しています。私は70を使用していUIImageViewsます。私UIImageViewsは single を使用していUITapgestureRecognizerます。しかし、 last でのみ機能しUIImageViewます。
UITapGgestureRecognizerそれで、そのすべてにシングルを使用する方法を教えてください。私のUIImageViewsコードは次のようになります
radiotap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(radiochanged:)];
radiotap.delegate=self;
a=[[UIImageView alloc]initWithFrame:CGRectMake(10, male.frame.origin.y, ima.size.width, ima.size.height)];
[a setImage:ima];
a.tag=0;
a.userInteractionEnabled=YES;
[a addGestureRecognizer:radiotap];
[scroll addSubview:a];
b=[[UIImageView alloc]initWithFrame:CGRectMake(10, female.frame.origin.y, ima.size.width, ima.size.height)];
[a setImage:ima];
b.tag=1;
b.userInteractionEnabled=YES;
[b addGestureRecognizer:radiotap];
[scroll addSubview:b];
このように、70 個の UIImageView を追加しました。