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

  • Home
  • SEARCH
  • 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 6574859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:18:54+00:00 2026-05-25T15:18:54+00:00

I have created a webview to display the pdf, now using the gesture recognizer

  • 0

I have created a webview to display the pdf, now using the gesture recognizer on single tap I have to call some method but single tap is not recognising

I have used this code

UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 450,450)];
UITapGestureRecognizer *DoubleFingerDTap = [[UITapGestureRecognizer alloc]
                                           initWithTarget:self action:@selector(screenTappedtwice:)];

DoubleFingerDTap.numberOfTapsRequired = 1;
[webView addGestureRecognizer:DoubleFingerDTap];

[DoubleFingerDTap release];

method called

- (void)screenTappedtwice:(UIGestureRecognizer *)sender {

    CGPoint tapPoint = [sender locationInView:sender.view.superview];


      [UIView beginAnimations:nil context:NULL];

    sender.view.center = tapPoint;

//Check the current state of the navigation bar...
    //BOOL navBarState = [self.navigationController isNavigationBarHidden];
//  Set the navigationBarHidden to the opposite of the current state.
//  [self.navigationController setNavigationBarHidden:TRUE animated:YES];


    [self.navigationController setNavigationBarHidden:YES animated:YES];

    [UIView commitAnimations];


}
  • 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-25T15:18:55+00:00Added an answer on May 25, 2026 at 3:18 pm

    Have you tried setting:

    - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
    

    to return YES? Also, ensure you set your tap gesture’s delegate to self so that the message is properly received. I just tested this in a new project and it does work.

    EDIT

    Not quite sure what your animation begin & commit is for – the method setNavigationBarHidden:animated: animates itself. Additionally, the use of these animation definitions are discouraged in iOS 4 onwards – look into using block-based animations on UIView instead.

    For your navigation controller, you are pretty much there – implement something like this:

    - (void)screenTappedTwice:(UITapGestureRecognizer *)sender
    {
        BOOL shouldHideNavBar = [self.navigationController isNavigationBarHidden] ? NO : YES;
        [self.navigationController setNavigationBarHidden:shouldHideNavBar animated:YES];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an application that loads a website using WebView. Everything works fine
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a C# class file by using a XSD-file as an input.
I have created a webservice in .net 2.0, C#. I need to log some
I am having some difficulty using a UIWebView to render PDF files on the
I am new to iphone development.I have created a view based application.Now i want
I have created a WebView programmatically. This works perfect. The code is below. What
I have created a WebView layout, which is used to access a specific website,
I have created a webview with a transparent background. browser = new WebView(ActivityActivate.this); browser.setBackgroundColor(0);
I have created a custom listview that have one webview per element. My problem

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.