5
uitableviewcells textlabel.textのhtmlマーキーエフェクトのようなものを実現する方法はありますか?uitableviewcellsのマーキーエフェクトtextlabel.text
uitableviewcells textlabel.textのhtmlマーキーエフェクトのようなものを実現する方法はありますか?uitableviewcellsのマーキーエフェクトtextlabel.text
NSTimerを使用して自分で実装する必要があります。あなたは、あなたのtextLabel.text
の文字を前方から取り出し、後方に追加することによって循環します。
- (void)fireTimer
{
NSMutableString *mutableText = [NSMutableString stringWithString: textLabel.text];
//Takes the first character and saves it into a string
NSString *firstCharText = [mutableText substringWithRange: NSMakeRange(0, 1)];
//Removes the first character
[mutableText deleteCharactersInRange: NSMakeRange(0, 1)];
//Adds the first character string to the initial string
[mutableText appendString: firstCharText];
textLabel.text = mutableText;
}
ヒントの –
おかげで完璧な答えだこと:この簡単にあなたが
substringWithRange:
deleteCharactersInRange:
とappendString
を使用して操作しますNSMutableString
を使用し、各文字操作後textLabel.text
として設定することができますを行うために。チャーミーのように働いた。 – versatilemindあまり滑らかではありませんが、結果とコードラインは完璧です! – JOM