私はiPhoneアプリでUIPickerviewコントロールに取り組んでいます.UIPickerViewの選択インジケータのタッチを検出したい.助けてください.今、私は次のコードを使用しています
UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(pickerViewTapGestureRecognized:)];
[self.picker addGestureRecognizer:gestureRecognizer];
-(void)pickerViewTapGestureRecognized:(UITapGestureRecognizer *)gestureRecognizer
{
CGPoint touchpoint = [gestureRecognizer locationInView:gestureRecognizer.view.superview];
CGRect frame = self.picker.frame;
CGRect selectorFrame = CGRectInset(frame, 0.0, self.picker.bounds.size.height * 0.85/2.0);
if (CGRectContainsPoint(selectorFrame, touchpoint)) {
}
}