Документация говорит ... Установите: < /p>
recognizer.cancelsTouchesInVew = NO;
< /code>
и добавить распознаватель в топ.UIView *custom_overlay_1 = [[UIView alloc] initWithFrame : given_frame];
UIView *custom_overlay_2 = [[UIView alloc] initWithFrame : given_frame];
UITapGestureRecognizer *custom_recognizer_1, *custom_recognizer_2;
custom_recognizer_1 = [[UITapGestureRecognizer alloc]
initWithTarget : self
action :@selector(handle_tap_1:)];
custom_recognizer_2 = [[UITapGestureRecognizer alloc]
initWithTarget : self
action :@selector(handle_tap_2:)];
[custom_recognizer_1 setCancelsTouchesInView: NO];
[custom_recognizer_2 setCancelsTouchesInView: NO];
[custom_overlay_1 addGestureRecognizer: custom_recognizer_1];
[custom_overlay_2 addGestureRecognizer: custom_recognizer_2];
- (int) handle_tap_1 : (UITapGestureRecognizer *) gesture
{
NSLog(@" *** *** handle_tap_1 !!!");
if (gesture.state == UIGestureRecognizerStateRecognized)
NSLog(@" *** *** recognized tap detected in handle_tap_1 !!!");
return (0);
}
- (int) handle_tap_2 : (UITapGestureRecognizer *) gesture
{
NSLog(@" *** *** handle_tap_2 !!!");
if (gesture.state == UIGestureRecognizerStateRecognized)
NSLog(@" *** *** recognized tap detected in handle_tap_2 !!!");
return (0);
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... ss-down-to
Как позволить uiView обращаться с жестом для TAP, а затем позвольте жесту TAP пройти вниз к Uiview под iOS15+ с помощью ⇐ IOS
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение