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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:42:54+00:00 2026-06-12T18:42:54+00:00

I have two UIViews. I’m using one to contain the other so that I

  • 0

I have two UIViews. I’m using one to contain the other so that I can slide one inside the other. I’m encountering an issue where even though a subView is clipped to the bounds of its parent, it is still receiving touch events and blocking access to other underlying views.

I have three screenshots that show the layout. I’ve coloured the parent green and the child red.



The idea is that the user clicks “View” and the subView slides up. When the subView is in the default position, the UITabBar is covered and cannot be clicked. You can see this in the first image where the red view is present at the bottom. When the subView is moved to the top, the UITabBar can be clicked as it’s now visible. In the third image, I’ve show what it’s like with clipToBounds enabled on the green UIView.

I’ve enabled clipToBounds, so I cannot understand why the subView is blocking the underlying UITabBar. Is my understanding of clipToBounds completely wrong??

  • 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-06-12T18:42:55+00:00Added an answer on June 12, 2026 at 6:42 pm

    Using clipToBounds only affects the visual layout of a subView, not the logical layout. This means that whilst my subView isn’t visible to the eye, it’s visible to touch.

    I’ve worked around this issue by animating the size of the subView rather than its position. In my code below, the stationProximityView is the subView. I animate its size by 40 pixels to bring the black title back into view.

    [UIView beginAnimations:@"stationProximityBar" context:NULL];
    self.stationProximityView.view.frame = CGRectOffset(self.stationProximityView.view.frame, 0, -40);
    [UIView commitAnimations];
    

    When I no longer need it, I animate it out of view.

    [UIView beginAnimations:@"stationProximityBar" context:NULL];
    self.stationProximityView.view.frame = CGRectMake(0 ,0, 320, 500);
    [UIView commitAnimations];
    

    If the user taps the view button, the entire subView is shown:

     [UIView beginAnimations:@"stationProximityBar" context:NULL];
     self.stationProximityView.view.frame = CGRectMake(0,460,320,40);
     [UIView commitAnimations];
    

    Dismissal causes the view to be hidden in the same way as the small bar.

     [UIView beginAnimations:@"hideStationProximityBar" context:NULL];
     self.stationProximityView.view.frame = CGRectMake(0,0,320,500);
     [UIView commitAnimations];
    

    At the moment, this code is only being tested on the iPhone 5, so the hard-coded height of 500 would causes issues on previous iPhone models.

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

Sidebar

Related Questions

I have a UIView container that has two UIImageView s inside it, one partially
I have an UIViewController that has two UIViews inside, whose layout (set in Interface
I currently have two UIViews: one of a red background and the other blue.
I have a two UIViews filled with UIButtons. I want to only allow one
I have one (1) .xib with two UIViews, one on the top 1/3, the
I need to have two UITableViews on one UIView. I can make it work
I have a TableViewController that is using a grouped Style and has two(2) sections.
I have two viewControllers, one is a subclass of UIViewController (autoresizes correctly), the other
i have two UIImageViews as childs in one UISCrollView. You can flip sideways to
I have two UIViews , both of which obviously have CGRects each. One UIView

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.