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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:30:43+00:00 2026-05-12T13:30:43+00:00

I am writing an iPhone app with a tab bar and navigation bar. At

  • 0

I am writing an iPhone app with a tab bar and navigation bar. At a certain point, I am pushing an instance of my DetailsViewController class onto the navigation controller stack to show it.

This controller creates its view hierarchy in code: the controller’s view property is set to a UIScrollView, which contains a plain UIView (let’s call it “contentView”) sized to hold all the content to be shown. At the bottom of this contentView, I have four UIButtons.

Now when I run the app (in the simulator at present), and scroll to the bottom of the view, the top two buttons respond to touches; the third responds to touches only in the top portion of it, and the lower button doesn’t respond to touches at all. By clicking in various parts of the third button, it appears that the lower 93 pixels of the scroll view is not passing touch events through to its subviews.

93 is suspicious: it’s also the combined height of the tab bar (49 pixels) and navigation bar (44 pixels). Yet the navigation bar and tab bar are outside the scroll view. Any suggestions why this might be happening?

Here’s the code in question:

- (void)loadView
{
    CGRect frame = [[UIScreen mainScreen] applicationFrame]; 
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:frame];
    scrollView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
    scrollView.delegate = self;
    self.view = scrollView;

    UIView *contentView = [[UIView alloc] initWithFrame:scrollView.bounds];
    contentView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
    [scrollView addSubview:contentView];

    CGSize viewSize = contentView.bounds.size;
    CGSize size;
    CGFloat y = 0;

    /* Snip creating various labels and image views */

    /* Actions view creates and lays out the four buttons; its sizeThatFits:
    ** method returns the frame size to contain the buttons */

    actionsView = [[PropertyDetailActionsView alloc] initWithFrame:CGRectZero];
    actionsView.autoresizingMask = (UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth);
    actionsView.delegate = self;
    size = [actionsView sizeThatFits:viewSize];
    actionsView.frame = CGRectMake(0, y, size.width, size.height);
    [contentView addSubview:actionsView];
    y += size.height;

    [contentView setFrame:CGRectMake(0, 0, viewSize.width, y)];
    scrollView.contentSize = contentView.frame.size;

    [contentView release];
    [scrollView release];
}
  • 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-12T13:30:44+00:00Added an answer on May 12, 2026 at 1:30 pm

    As I suggested on Twitter yesterday, it may have something to do with the flexible bottom margin set to the actionsView.

    That suggestion did not resolve the problem, yet it lead to the right direction. By removing the flexible height of the contentView the problem has been fixed.

    So if anyone out there is having similar problems, try to play with your autoresizingMasks.

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

Sidebar

Related Questions

I'm writing an iPhone app. Starting from a view controller in a navigation stack
I'm writing a Navigation-Based iPhone app, and I'd like to have a UIToolBar docked
I am writing an iPhone application that contains a tab controller, each tab item
I'm writing an iPhone app which uses a keypad that includes a decimal point.
I am writing an iPhone app that when a certain thing occurs, a sound
I have an iPhone app with 4 tab bar items. One of them is
I am writing a IPhone App. In it there is a search bar (UISearchBar
I'm writing an iPhone App that relies on getting the device location. Management have
I am writing an iPhone app – a client for some social network. The
I'm writing an iPhone app for a client, and they have requested a feature

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.