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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:28:49+00:00 2026-06-01T02:28:49+00:00

I need to create more than one UIView with MARQUEE effect like HTML <marquee>

  • 0

I need to create more than one UIView with MARQUEE effect like HTML <marquee> tag.

I first need to create UIView dynamically.

After add a MARQUEE effect for dynamically created UIView.

Any help will be appreciated.

  • 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-01T02:28:50+00:00Added an answer on June 1, 2026 at 2:28 am

    Do you mean a view that can display a collection of strings that are wider than the view’s width which it displays by slowly scrolling them from right to left? You’d need to build it. I did once, by subclassing UIScrollView like this:

    // CrawlView.h
    
    #import <UIKit/UIKit.h>
    
    @interface CrawlView : UIScrollView
    
    @property (assign, nonatomic) NSTimeInterval period;
    @property (strong, nonatomic) NSMutableArray *messages;
    
    - (void)go;
    
    @end
    
    
    // CrawlView.m
    
    #import "CrawlView.h"
    
    // distance between neighboring strings.  could make this a public property
    #define kPADDING 16.0
    
    @interface CrawlView ()
    
    @property (assign, nonatomic) CGFloat messagesWidth;
    
    @end
    
    @implementation CrawlView
    
    @synthesize period=_period;
    @synthesize messages=_messages;
    @synthesize messagesWidth=_messagesWidth;
    
    - (void)buildSubviews {
    
        for (UIView *subview in [self subviews]) {
            if ([subview isKindOfClass:[UILabel self]]) {
                [subview removeFromSuperview];
            }
        }
    
        CGFloat xPos = kPADDING;
    
        for (NSString *message in self.messages) {
            UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
            label.text = message;
            CGSize size = [message sizeWithFont:label.font];
            CGFloat width = size.width + kPADDING;
            label.frame = CGRectMake(xPos, 0.0, width, self.frame.size.height);
            [self addSubview:label];
            xPos += width;
        }
        self.messagesWidth = xPos;
        self.contentSize = CGSizeMake(xPos, self.frame.size.height);
        self.contentOffset = CGPointMake(-self.frame.size.width, 0.0);
    }
    
    - (void)setMessages:(NSMutableArray *)messages {
    
        if (_messages != messages) {
            _messages = messages;
            [self buildSubviews];
        }
    }
    
    - (void)go {
    
        if (!self.period) self.period = self.messagesWidth / 100;
        // so it always takes about the same (fudged, but reasonable) amount of time to scroll the whole array
    
        [UIView animateWithDuration:self.period
                              delay:0.0
                            options:UIViewAnimationOptionCurveLinear |UIViewAnimationOptionRepeat
                         animations:^{
                             self.contentOffset = CGPointMake(self.messagesWidth, 0.0);
                         } completion:^(BOOL finished){}];
    }
    
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a stored proc that will return records (more than one
I need to create mysql stored procedure which makes more than one insert at
i need to create a .doc file that has more than one page. I
Is it possible for more than one site to share a cookie or create
Here is my problem. I need more than one row from the database, and
I need to change an interface that is used by more than one app.
I use more than one class and I need a... lets say Global storage
I have domain that has more than one unique fields like the following class
I have dynamically created WrapPanel (_wp) with several Borders. And I need create handler
I've a JSP/Servlet Web App that consist of more than one servlet (and some

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.