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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:20:50+00:00 2026-06-05T13:20:50+00:00

In my program I have configured a UIView to be placed over a number

  • 0

In my program I have configured a UIView to be placed over a number of UIBUttons. This is so you can pan across the view and have the buttons move over as well as selecting the buttons themselves. However, it is not possible to select the buttons when they are underneath this UIView. Does anybody know how to configure a UIButton‘s userInteractionEnabled while it is under these conditions?

  • 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-05T13:20:53+00:00Added an answer on June 5, 2026 at 1:20 pm

    This technique has worked for me – caveat: I just typed this in it’s not compiled or nuthin it’s given as a starting point.

    1. Create the buttons and place them at the top of the view hierarchy (i.e. where they interact normally and respond to taps, on top of the UIView)
    2. When creating the buttons – keep a reference to them in an array.

      NSMutableArray* arrayOfPeskyButtons;

    3. Keep a record of the button frames

      NSMutableArray* arrayOfPeskyFrames = [NSMutableArray mutableArray];
      for ((UIButton*)button in arrayOfPeskyButtons)
      {
          [arrayOfPeskyFrames addObject:[NSValue valueWithCGRect:button.frame];
      }
      
    4. When your app responds to an action on the UIView – panning or if you change it to a UIScrollView (probably best btw), then move the frame of the buttons correspondingly so that they appear fixed in place to the user.

    I have used this technique to create ‘overlays’ of buttons which sit on top of scrollviews and it works surprisingly well. Simply in the scrollView delegate method.

    -(void)scrollViewDidScroll:(UIScrollView *)scrollView
    

    take note of the scrollviews offset and adjust each of the frames of the buttons accordingly depending on the offset of the scrollView

     CGPoint offset = scrollView.contentOffset;
    

    Iterate through the array of buttons and move them.

     int index = 0;
     for ((UIButton*)button in arrayOfPeskyButtons)
     {
         CGRect originalFrame = [[arrayOfPeskyFrames objectAtIndex:index]CGRectValue];
         CGRect currentFrame = button.frame;
         //adjust frame
         //e.g.
         currentFrame.origin.x = originalFrame.origin.x + offset.x;
    
         button.frame = currentFrame.;
         index++;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have program, that must interact with a console program before my program can
I have program that runs fast enough. I want to see the number of
I have been asked to program a routine to decide the number of possible
I have a some computation program. Now, this program is a single-thread, I need
I have a program which is configured by the user by using C++ classes
I have a question about buffer overflaw, in this program : #include <stdio.h> #include
I have a J2SE program that I'm moving over to use JPA. The existing
In my program I need to programmatically configure an ApplicationContext. Specifically, I have a
I have program written in C. It takes 2 arguments username/password and try to
I have program that requires Python 3, but I develop Django and it uses

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.