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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:37:16+00:00 2026-06-04T04:37:16+00:00

I’m having some problems in my application. The error occurs when I’m in a

  • 0

I’m having some problems in my application. The error occurs when I’m in a screen with a lot of icons (UIViews), each one running a animation. This screen reminds the springboard screen, and the animation visual is similar too.

So, if I press the home button, the application doesn’t goes to background and I can’t do anything. Even the power button doesn’t work. And the icons continue shaking.

If I remove the call for label creation method, this don’t happens.

Any advice?

Thanks!

Animation method (extracted from Three20 api):

- (void)wobble {
    static BOOL wobblesLeft = NO;

    if (isEditing)
    {
        CGFloat rotation = (kWobbleRadians * M_PI) / 180.0;
        CGAffineTransform wobbleLeft = CGAffineTransformMakeRotation(rotation);
        CGAffineTransform wobbleRight = CGAffineTransformMakeRotation(-rotation);

        [UIView beginAnimations:nil context:nil];

        NSInteger i = 0;
        NSInteger nWobblyButtons = 0;



        for(Icon *ic in iconList)
        {
            ++nWobblyButtons;
            i++;
            if (i % 2)
            {
                ic.transform = wobblesLeft ? wobbleRight : wobbleLeft;

            } else {
                ic.transform = wobblesLeft ? wobbleLeft : wobbleRight;
            }
        }


        if (nWobblyButtons >= 1)
        {
            [UIView setAnimationDuration:kWobbleTime];
            [UIView setAnimationDelegate:self];
            [UIView setAnimationDidStopSelector:@selector(wobble)];
            wobblesLeft = !wobblesLeft;

        } else {
            [NSObject cancelPreviousPerformRequestsWithTarget:self];
            [self performSelector:@selector(wobble) withObject:nil afterDelay:kWobbleTime];
        }

        [UIView commitAnimations];
    }
}

Label creation

-(void)layoutLabel
{
    // If title isn`t builded.
    if(_lblName == nil)
    {
        // Create new label.
        _lblName = [[UILabel alloc] initWithFrame:CGRectMake(LABEL_POS_X,
                                                             LABEL_POS_Y,
                                                             LABEL_WIDTH,
                                                             LABEL_HEIGHT)];

        // Clear the background.
        [_lblName setBackgroundColor:[UIColor clearColor]];

        // Sets the font.
        [_lblName setFont:[UIFont fontWithName:@"Helvetica-Bold" size:11.3]];
        [_lblName setAdjustsFontSizeToFitWidth:NO];

        // Sets text color
        [_lblName setTextColor:[UIColor whiteColor]];

        // Adjust the number of lines.
        [_lblName setNumberOfLines:2];

        // Adjust the aligment to center.
        [_lblName setTextAlignment:UITextAlignmentCenter];

        // Adjust shadow like the springboad`s icons.
        _lblName.layer.shadowOpacity = 1.0;
        _lblName.layer.shadowRadius = 0.8;
        _lblName.layer.shadowColor = [[UIColor blackColor] CGColor];
        _lblName.layer.shadowOffset = CGSizeMake(0, 1.2);

        // Add label to container.
        [self addSubview:_lblName];
    }
}
  • 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-04T04:37:17+00:00Added an answer on June 4, 2026 at 4:37 am

    The problem is:

    For each icon I have many subviews, so, the calculations of each icon, at animation time, resulted in a slow code.

    So, I found some light to solve this. I builded the same icon structure, but, after, I merged everithing inside a UIImage with a code below.

    + (UIImage *) imageWithView:(UIView *)view
    {
        UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
        [view.layer renderInContext:UIGraphicsGetCurrentContext()];
    
        UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
    
        UIGraphicsEndImageContext();
    
        return img;
    }
    

    This increased my FPS from ~15 to 60 O.o

    Follow some help that I found
    Link

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I am currently running into a problem where an element is coming back from

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.