2017-03-25 7 views
1

Ich zeige Dateiübertragungsfortschritt in einem Etikett an. Aber wenn die fileprogress Datenfolge erscheint als directionstring Text blinkt entsprechend seiner Position. Wie kann man das Blinken der angehängten Zeichenfolge stoppen?UILabellentext blinkend, wenn Dateifortschrittstext angezeigt wird

directionstring = @"uploaging file"; 
fileprogress = transferring rate EX.(25.00 MB of 50.00 MB); 
message = [message stringByAppendingString:[NSString stringWithFormat:@"%@%@",fileprogress,directionstring]]; 
progressLabel.text = message; 
+0

wird Sie das Etikett neu gezeichnet werden könnte !! @ psk –

Antwort

0

ich ein Beispiel aus (mit Timer Fortschritt zu emulieren), testen, Text blinkt nicht

@implementation ViewController 
{ 
    IBOutlet UILabel *_progressLabel; 
    NSInteger _percent; 
} 

- (void)showProgress 
{ 
    _percent = 0; 

    [NSTimer scheduledTimerWithTimeInterval:0.2 
            target:self 
            selector:@selector(updateProgress:) 
            userInfo:nil 
            repeats:YES]; 
} 

- (void)updateProgress:(NSTimer *)timer { 
    NSString *directionstring = @" uploading file"; 
    NSString *fileprogress = [NSString stringWithFormat:@"%ld of 100", (long)_percent++]; 
    NSString *message = [NSString stringWithFormat:@"%@%@", fileprogress, directionstring]; 
    _progressLabel.text = message; 
} 

@end 
Verwandte Themen