スクロールビューで画像を追加しました。長押しすると、すべての画像にぐらつきアニメーションが表示されます。そのようなアプリケーションをアンインストールするときに、iPhoneのようにすべての画像の右上隅に削除ボタンを表示したいと思います。
- (void)startWobble {
for (UIView *imgView in viewsInScrollView) {
UIButton *deleteImgButton = [[UIButton alloc] initWithFrame:CGRectMake(55,-7,12,12)];
[deleteImgButton setImage:[UIImage imageNamed:@"close_icon.png"] forState:UIControlStateNormal];
[deleteImgButton addTarget:self action:@selector(deleteImage:) forControlEvents:UIControlEventTouchUpInside];
[imgView addSubview:deleteImgButton];
imgView.transform = CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(-5));
[UIView animateWithDuration:0.20
delay:0.0
options:(UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse)
animations:^ {
imgView.transform = CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(5));
}
completion:NULL
];
}
}
-(void)deleteImage : (id)sender {
NSLog(@"Delete Image");
}
ここではセレクターが呼び出されていません....どうすればこれを解決できますか..???