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 996961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:57:26+00:00 2026-05-16T06:57:26+00:00

All touch-events are recogniced perfectly before I push my programmatically created ViewController. I think

  • 0

All touch-events are recogniced perfectly before I push my programmatically created ViewController.
I think there is no connection between the new ViewController and my code.

That’s my code where i push the ViewController:

UIViewController *detail = [[UIViewController alloc] init];
CGRect frame = CGRectMake(0, -44, 320, 411);
UIView *galleryView = [[UIView alloc] initWithFrame:frame];
UIImageView *galleryImageView = [[[UIImageView alloc] initWithFrame:frame] autorelease];
galleryImageView.image = [UIImage imageNamed:@"bg.png"];
[galleryView addSubview:galleryImageView];
detail.view = galleryView;

frame = CGRectMake(0, 0, 320, 367);
int height = (([photo_id count] - 1) / 3);
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:frame];
scrollView.contentSize = CGSizeMake(320, (height * 102) + 12);
scrollView.showsHorizontalScrollIndicator = NO;
scrollView.showsVerticalScrollIndicator = NO;
scrollView.scrollsToTop = NO;

[galleryView addSubview:scrollView];

int z = 0;

for (int x = 0; x < ([photo_id count] / 3); x++) {
    for (int y = 0; y <= 2; y++) {

        frame = CGRectMake((y * 90) + (y * 12) + 18, (x * 90) + (x * 12) + 18, 76, 76);
        AsyncImageView *imageView = [[AsyncImageView alloc] initWithFrame:frame];
        frame = CGRectMake((y * 90) + (y * 12) + 12, (x * 90) + (x * 12) + 12, 90, 90);
        UIImageView *borderView = [[UIImageView alloc] initWithFrame:frame];
        NSString *flickrURL = [photo_secret objectAtIndex:z];
        NSURL *url = [NSURL URLWithString:flickrURL];
        imageView.backgroundColor = [UIColor whiteColor];
        imageView.opaque = NO;
        imageView.contentMode = UIViewContentModeScaleAspectFill;
        [borderView setUserInteractionEnabled:YES];
        borderView.tag = z;
        NSLog([NSString stringWithFormat:@"%i", borderView.tag]);
        [imageView loadImageFromURL:url];
        borderView.image = [UIImage imageNamed:@"img_border.png"];
        z++;
        [scrollView addSubview:imageView];
        [scrollView addSubview:borderView];
    }
}


[self.navigationController pushViewController:detail animated:YES];

Touch-Events are logged with following code:

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

    UITouch *touch = [[event allTouches] anyObject];

    UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Hinweis" message:[NSString stringWithFormat:@"%d", touch.view.tag] delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
    [errorAlert show];

    NSLog([NSString stringWithFormat:@"%i", touch.view.tag]);   
}
  • 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-16T06:57:27+00:00Added an answer on May 16, 2026 at 6:57 am

    I found the solution:
    Subclass the UIScrollView and add touchEventHandling.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.