| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- //
- // UploadCell.m
- // RA Image
- //
- // Created by Jack on 2017/5/5.
- // Copyright © 2017年 USAI. All rights reserved.
- //
- #import "UploadCell.h"
- #import "const.h"
- @interface UploadCell ()
- @property (strong, nonatomic) IBOutlet UILabel *nameLabel;
- @property (strong, nonatomic) IBOutlet UIProgressView *progressView;
- @property (strong, nonatomic) IBOutlet UILabel *progressIndicator;
- @property (strong, nonatomic) IBOutlet UILabel *errorLabel;
- @property (strong, nonatomic) IBOutlet UILabel *stateLabel;
- @end
- @implementation UploadCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- - (void)setName:(NSString *)name {
- _name = name;
- self.nameLabel.text = name;
- }
- - (void)setProgress:(float)progress {
-
- // DebugLog(@"cell %p setProgress %f",self,progress);
- if (progress < 0) {
- progress = 0.0f;
- }
- if (progress > 1) {
- progress = 1.0f;
- }
- _progress = progress;
- self.progressView.progress = progress;
- progress = progress * 100;
- self.progressIndicator.text = [NSString stringWithFormat:@"%.1f%%",progress];
- }
- - (void)setState:(NSString *)state {
- _state = state;
- self.stateLabel.text = state;
- }
- - (void)setErrorMsg:(NSString *)errorMsg {
- _errorMsg = errorMsg;
- if (errorMsg.length) {
- self.errorLabel.hidden = NO;
- self.errorLabel.text = errorMsg;
- } else {
- self.errorLabel.hidden = YES;
- self.errorLabel.text = nil;
- }
- }
- @end
|