2016-08-10 4 views
0

のUITableViewCell内部progressViewを使用する場合、私がようにUIProgressViewは、実際のフロート100

 cell.imageView.file = (PFFile *)object[@"image"]; 
     [cell.imageView loadInBackground:^(UIImage * _Nullable image, NSError * _Nullable error) { 

     } progressBlock:^(int percentDone) { 
      NSLog(@"%d",percentDone); 
      dispatch_async(dispatch_get_main_queue(), ^{ 
       [cell.progressBar setProgress:percentDone animated:YES]; 
      }); 
      if (percentDone == 100) { 
       [cell.progressBar setHidden:YES]; 
      } 

     }]; 

percentDone 100に到達する前に、イムNSLogging percentDone、及びprogressView 100に到達使用される前に、100の評価になります。これは2番目のセルにあるので、多分再利用と何か関係がありますか?

答えて

3

UIProgressViewの進捗は、0.001.00の間の値で表されます。値が0から100の整数の場合は、それらを掛ける数値を0.01とします。

[cell.progressBar setProgress:percentDone * 0.01 animated:YES]; 
+0

ありがとう、私はそれについて完全に忘れてしまった! – Prgmmr

関連する問題