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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:08:38+00:00 2026-05-15T23:08:38+00:00

I have a UIView that contains a couple UIButtons that I am animating from

  • 0

I have a UIView that contains a couple UIButtons that I am animating from offscreen to onscreen. I find that the region where they are heading is clickable before they reach it. The animation is pretty simple, so I’m wondering if there is something obvious that I am missing in terms of telling the code to not treat the button as if it is at the final destination (I’m not sure if that is supposed to be the expected behavior and the animation is purely a visual while the clickable region is instantaneously at the destination; I wouldn’t expect it to be).

Here is the code I use to animate it. It’s basically switching out a sub panel and bringing back a main panel with buttons:

    // switch back to main abilities panel
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration: kFadeInTime];
    CGRect rect = CGRectMake(
        480.0f,
        mAbilities.mSubPanel.frame.origin.y,
        mAbilities.mSubPanel.frame.size.width,
        mAbilities.mSubPanel.frame.size.height);
    mAbilities.mSubPanel.frame = rect;
    [UIView commitAnimations];

    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration: kFadeInTime];
    [UIView setAnimationDelay: kFadeInTime];
    rect = CGRectMake(
        kAbilitiesBorderX,
        mAbilities.mPanel.frame.origin.y,
        mAbilities.mPanel.frame.size.width,
        mAbilities.mPanel.frame.size.height);
    mAbilities.mPanel.frame = rect;
    [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-15T23:08:39+00:00Added an answer on May 15, 2026 at 11:08 pm

    As a workaround you can disable user interaction with your panel before animations and reenable it when animation finishes:

    // Animation compete handler
    - (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context{
        mAbilities.mSubPanel.userInteractionEnabled = YES;
    
    }
    
    // Animating panel
    mAbilities.mSubPanel.userInteractionEnabled = NO;
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration: kFadeInTime];
    [UIView setAnimationDelegate: self];
    CGRect rect = CGRectMake(
        480.0f,
        mAbilities.mSubPanel.frame.origin.y,
        mAbilities.mSubPanel.frame.size.width,
        mAbilities.mSubPanel.frame.size.height);
    mAbilities.mSubPanel.frame = rect;
    [UIView commitAnimations];
    

    If you’re targeting iOS4 you can (and as specs say should) use block-based animation api:

    [UIView animateWithDuration:5.0f delay:0.0f options:UIViewAnimationOptionLayoutSubviews
             animations:^(void){
                 CGRect rect = CGRectMake(
                                         480.0f,
                                         mAbilities.mSubPanel.frame.origin.y,
                                         mAbilities.mSubPanel.frame.size.width,
                                         mAbilities.mSubPanel.frame.size.height);
                          mAbilities.mSubPanel.frame = rect;
             } 
             completion:NULL
         ];
    

    While animating using blocks user interaction is disabled by default – you can enable it by setting UIViewAnimationOptionAllowUserInteraction flag in options parameter:

    ... options:UIViewAnimationOptionLayoutSubviews | UIViewAnimationOptionAllowUserInteraction ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a NIB with a UIView that contains some UILabels, UIButtons etc. and
I have a UIView that contains a number of CALayer subclasses. I am using
I have a UIView that contains a UIScrollView and I want to be able
I have a custom UIView that contains an interactive drawing that is drawn in
I have a UIView -- call it HomeView that contains a UITableView and a
I have a UIScrollView that contains a custom UIView. In my UIView I am
I have a NIB that contains a UIView. I have another NIB that contains
I have a zooming UIScrollView that contains a UIView which contains some custom UIViews
Hi I have a UIView which contains several buttons that are designed by others
I have a UIView that contains a row of subclasses of UIView . The

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.