iphoneアプリを開発し、UIImageviewを使用し、不規則な形状の画像を設定しました
// uiimageview type shutter
shutter = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,32.5)];
//setting image on shutter
UIImage* shutterimg = [UIImage imageNamed:@"trayshutter.png"];
[shutter setImage:shutterimg];
// User interaction
shutter.userInteractionEnabled=YES;
そして私はtouchesbeganを使用してタッチを取得します
すべて問題ありませんが、問題は、imageviewのCGRectMake(つまり、0,0,320,32.5)が占めるすべての長方形領域でイベントを取得するのに対し、画像(-----の形状)でのみイベントを必要とすることです。 ||||| -----)。
cgrectmakeでカバーされている残りの領域ではなく、画像でのみイベントを取得するようにするにはどうすればよいですか?