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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:37:36+00:00 2026-06-07T10:37:36+00:00

How do we go about animating the UILabel ‘s width so that it increases

  • 0

How do we go about animating the UILabel‘s width so that it increases and decreases in width only using UIView animateWithDuration

Thank you for your help (at this point i’m so frustrated as I’ve been trying to do so but it does not work)

  • 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-07T10:37:38+00:00Added an answer on June 7, 2026 at 10:37 am

    I was able to do it in this way. self refers to the view in which i’m adding the label. in the init, add the label with width as 1 px. then use the below.. the UIViewAnimationOptionBeginFromCurrentState allows it to be opened like a door PHEW!

        [UIView animateWithDuration:1. delay:0 options:UIViewAnimationOptionBeginFromCurrentState  animations:^{
            [self setFrame:CGRectMake(self.frame.origin.x-labelSize.width-PADDING, self.frame.origin.y, self.frame.size.width+labelSize.width+PADDING, self.frame.size.height)];
            [self.messageLabel setFrame:CGRectMake(95, 10, labelSize.width, labelSize.height)];
            self.messageLabel.alpha = 1; 
        } completion:^(BOOL finished) {
            [UIView animateWithDuration:1. delay:2. options:0  animations:^{
                self.messageLabel.alpha = 0;  
            } completion:^(BOOL finished) {
                [UIView animateWithDuration:1. delay:0. options:0  animations:^{
                    [self setFrame:CGRectMake(self.frame.origin.x+labelSize.width+PADDING, self.frame.origin.y, self.frame.size.width-labelSize.width-PADDING, self.frame.size.height)];
                } completion:^(BOOL finished) {
                }];
            }];
        }];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm animating a UIView by updating its anchorpoint 60 times a second using an
I am wondering how I would go about animating a UIView's to a specific
I have a UIView I'm animating in so that the user can select something
About 10 years ago, I was using a computer language called INFO on an
Is it possible to animate something that you have drawn using core graphics in
I need to cache about 100 different selections for animating. The following is sample
I've got an animating tool (Koolmoves) that produces SWF files as its output. Is
How could I go about animating a row in a table view? I've had
If animating an image, such as a metal ball, and it is about 20
I've been working on a program in C# that involves image editing and animating.

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.