iphone dev question: how to marquee text from string

22 views
Skip to first unread message

loon tech

unread,
Mar 6, 2010, 4:22:50 PM3/6/10
to mobile-...@googlegroups.com
I am tired of pulling my hair out about this.
can someone lead me to what object will get me to what I want?
Thanks, 
Jon

marleneZ

unread,
Mar 6, 2010, 10:23:14 PM3/6/10
to Mobile Portland
I found this code on the web - haven't tested it though. Hope it
helps.

Marlene

I found this code on the web - hope it helps


*I Created a container view.

messageView = [[UIView alloc] initWithFrame:CGRectMake(27, 0, 235,
19)];
[messageView setClipsToBounds:YES];//With This you prevent the
animation to be drawn outside the bounds.

*Then I created a UILabel with the text to be displayed and added to
my container view

lblTime = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 235, 19)];
[lblTime setBackgroundColor:[UIColor clearColor]];
[messageView addSubview:lblTime];

*Finally I created a function like this:

(void)sendNotificationNSString*)txt{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:3.5];
[UIView setAnimationTransition:UIViewAnimationTransitionNo ne
forView:messageView cache:YES];
[lblTime setText:txt];
[lblTime setTextAlignment:UITextAlignmentLeft];
lblTime.frame = CGRectMake(260, 0, 258, 19);
[UIView commitAnimations];

Reply all
Reply to author
Forward
0 new messages