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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:25:10+00:00 2026-05-11T02:25:10+00:00

Right, I’m trying to get a label with text in it (done already obviously),

  • 0

Right, I’m trying to get a label with text in it (done already obviously), which scrolls across the screen.

The text that is input into the label is done by a UITextField and a UIButton. This updates fine.

But I’m trying to get the UILabel to resize accordingly to the amount of text input, so that the WHOLE lot of text scrolls across the screen.

This is the code I have at the moment for the scrolling label:

[lblMessage setText: txtEnter.text];  CABasicAnimation *scrollText;  scrollText=[CABasicAnimation animationWithKeyPath:@'position.x']; scrollText.duration = 3.0; scrollText.repeatCount = 10000; scrollText.autoreverses = NO; scrollText.fromValue = [NSNumber numberWithFloat:500]; scrollText.toValue = [NSNumber numberWithFloat:-120.0];  [[lblMessage layer] addAnimation:scrollText forKey:@'scrollTextKey']; 

The problem is, sometimes is starts scrolling in the middle of the screen, and sometimes vanishes before it has fully gone acrosss.

It also cuts of text due to the label being one size.. I don’t know how to change this.

Thanks in advance.

Dom

  • 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. 2026-05-11T02:25:10+00:00Added an answer on May 11, 2026 at 2:25 am

    I believe something similar to the solution for this question would work for this case.

    You could embed the UILabel in a UIScrollView, with the UIScrollView set to the max size of the label that you want to display on the screen at one time. The UIScrollView would need to have its scroll indicators turned off using its showsHorizontalScrollIndicator and showsVerticalScrollIndicator properties. On a change of text, you could do the following:

    [lblMessage setText: txtEnter.text]; [lblMessage sizeToFit]; scrollView.contentSize = lblMessage.frame.size; 

    followed by the panning animation code as described in the above-linked question, with the frame to be panned to being the far right of the UILabel. This would cause the text to scroll at a constant rate across the label. If you want the label to scroll back to the beginning, you could use the UIView setAnimationRepeatAutoreverses: and setAnimationRepeatCount: methods in the beginning of your animation block.

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

Sidebar

Related Questions

Right now I am trying to use selenium ide to write code that makes
Right now, I keep all of my projects on my laptop. I'm thinking that
Right now I have a database (about 2-3 GB) in PostgreSQL, which serves as
Right now I have an SSIS package that runs every morning and gives me
Right. So I've created a stored procedure in a MySQL DB which happens to
right now Im searching for like 6h to get into it! My brain is
Right now I can name the subroutine printargs as follows to get the dump.
Right now I'm working on a project, which will read mails from pop3 inbox
Right now I am trying to save a variable when i close the app
Right now I'm having an issue with a Singleton that I just wrote for

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.