Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7163795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:57:46+00:00 2026-05-28T13:57:46+00:00

I have a UIScrollview with paging enabled. There are 3 views (pages) inside this

  • 0

I have a UIScrollview with paging enabled. There are 3 views (pages) inside this scroll view. There’s a tap gesture on the parent view of the scrollview that shows and hides a navigation bar at the top.

The Problem:
In one of the pages I want to add buttons. But the problem is that whenever i tap these buttons, the show/hide navigation bar method is also fired. What is the best way to pass the touch only to these buttons and not the the parent view of the scrollview?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:57:47+00:00Added an answer on May 28, 2026 at 1:57 pm

    NJones is on the right track, but I think there are some problems with his answer.

    I assume that you want to pass through touches on any button in your scroll view. In your gesture recognizer’s delegate, implement gestureRecognizer:shouldReceiveTouch: like this:

    - (BOOL)gestureRecognizer:(UIGestureRecognizer *)recognizer shouldReceiveTouch:(UITouch *)touch {
    
        UIView *gestureView = recognizer.view;
        // gestureView is the view that the recognizer is attached to - should be the scroll view
    
        CGPoint point = [touch locationInView:gestureView];
        UIView *touchedView = [gestureView hitTest:point withEvent:nil];
        // touchedView is the deepest descendant of gestureView that contains point
    
        // Block the recognizer if touchedView is a UIButton, or a descendant of a UIButton
        while (touchedView && touchedView != gestureView) {
            if ([touchedView isKindOfClass:[UIButton class]])
                return NO;
            touchedView = touchedView.superview;
        }
        return YES;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIScrollView that contains a UIView inside. The UIScrollView has paging enabled
I have an ScrollView for display PDF Pages. When I scroll the this shows
I have a UIScrollView with paging enabled. After I change the view from landscape
I have a view controller with a paging scrollview displaying pages of data to
I have a scrollView with paging enabled and a number N of pages, which
I have UIScrollView in my view. Problem is that if I slightly scroll it
I have a UIScrollView with 2 pages, and I can scroll horizontally between them.
I have a UIScrollView with paging enabled, and that works fine. Now I want
I have a UIScrollView with paging enabled. Each page is of width 768.0px in
I have a UIScrollView 's paging enabled and set its clipToBounds = NO so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.