2014-07-23 88 views
0

我使用庫AutoScrollLabelautoScrollLabel類似跑馬燈,它的工作完美,當我需要從label滾動從左到右。IOS自動滾動標籤從右到左滾動

但是,當我必須從正確的使用方向走了,我也面臨這個問題:

標籤從最後一個字開始的第一?

爲什麼?

您可以在下面找到我的代碼:

self.autoScrollLabel.textColor = [UIColor whiteColor]; 
self.autoScrollLabel.labelSpacing = 1; // distance between start and end labels 
self.autoScrollLabel.pauseInterval = 0; 
self.autoScrollLabel.scrollSpeed = 70; // pixels per second 
self.autoScrollLabel.textAlignment = NSTextAlignmentCenter; 
self.autoScrollLabel.fadeLength = 0; 
self.autoScrollLabel.scrollDirection = CBAutoScrollDirectionRight; 
self.autoScrollLabel.text = [NSString stringWithFormat:@"%@%@",@"",@"hello hello1 hello1 heeloo3 hello3 hebe hehehe hgdghdhg he e e hehee hehee hehehehehehhe"]; 
+0

檢查此.. http://stackoverflow.com/questions/22397122/how-to-move-text-from-right-to-left-in-ios-programatically –

+0

@KiritModi謝謝,但thi s不是我需要做的 – Houssam

回答

0

我從來沒有用過AutoScrollLabel類,但我認爲,爲了一切正常,當你滾動到你應該改變屬性

self.autoScrollLabel.scrollDirection = CBAutoScrollDirectionLeft