Имам етикет и текст вътре. Искам текстът ми да се движи по ширината на етикета като цифрово информационно табло. Как да направите това в iOS? Опитах с този код (който взех от тук: http://www.youtube.com/watch?v=EFoNEjPwTXM ), но не работи:
В .m файла:
-(void)time: (NSTimer *) theTimer
{
currentSong.center = CGPointMake(currentSong.center.x - 3.5, currentSong.center.y);
if (currentSong.center.x < - (currentSong.bounds.size.width/2))
{
currentSong.center = CGPointMake (320 + (currentSong.bounds.size.width/2), currentSong.center.y);
}
}
In viewDidLoad
:
timer = [NSTimer timerWithTimeInterval:0.09 target:self selector:@selector(time:) userInfo:nil repeats:YES];
Във файла .h:
IBOutlet UILabel *currentSong;
IBOutlet NSTimer *timer;
-(void)time: (NSTimer *) theTimer;
@end