Question

I face the problem of have long titles in different pushed views. I thought about resize the size of it dynamically and I had no problems at all, but this could be ugly with really long titles, so I thought about the text banners that shows text within an animation.

Is there a way to use UIView animation with the titleView for move the entire text (masked)?

Cheers

Was it helpful?

Solution

Try this custom control first..

AutoScroll Label

Method 2

UIView *myView = [[UIView alloc] initWithFrame: CGRectMake(0, 0, 300, 30)]; 
UILabel *title = [[UILabel alloc] initWithFrame: CGRectMake(40, 0, 300, 30)];

title.text = NSLocalizedString(@"My Title", nil);
[title setTextColor:[UIColor whiteColor]];
[title setFont:[UIFont boldSystemFontOfSize:20.0]];

[title setBackgroundColor:[UIColor clearColor]];
UIImage *image = [UIImage imageNamed:@"MyLogo.png"];
UIImageView *myImageView = [[UIImageView alloc] initWithImage:image];

myImageView.frame = CGRectMake(0, 0, 30, 30); 
myImageView.layer.cornerRadius = 5.0;
myImageView.layer.masksToBounds = YES;
myImageView.layer.borderColor = [UIColor lightGrayColor].CGColor;
myImageView.layer.borderWidth = 0.1;

[myView addSubview:title];
[myView setBackgroundColor:[UIColor  clearColor]];
[myView addSubview:myImageView];
self.navigationItem.titleView = myView;

OTHER TIPS

There are lots of free open source controls for this purpose but this is the control that i have used its handy one TickerView

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top