Przeglądaj źródła

1.下载预览页加无数据显示

huangxiaodong 1 rok temu
rodzic
commit
fcaf730231

+ 27 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/downLoadFile/downLoadPreviewViewController.m

@@ -12,8 +12,9 @@
 #import "downloadThumbnailManager.h"
 #import "downloadManager.h"
 #import "uploadFileRecordViewController.h"
+#import "UIScrollView+EmptyDataSet.h"
 
-@interface downLoadPreviewViewController ()<UITableViewDelegate,UITableViewDataSource>
+@interface downLoadPreviewViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
 @property (nonatomic, strong) UITableView *tableView;
 @property (nonatomic, strong) UIButton *rightButton;
 @property (nonatomic, strong) downloadFileBottomView *downloadFileBottomV;
@@ -106,6 +107,9 @@
             _tableView.sectionHeaderTopPadding = 0;
         }
         
+        //空数据引入第三方开源处理
+        _tableView.emptyDataSetSource = self;
+        _tableView.emptyDataSetDelegate = self;
     }
     
     return _tableView;
@@ -163,6 +167,28 @@
     return 70;
 }
 
+#pragma mark 空数据
+- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
+    
+    NSString *imageName = @"uploadFile_noData";
+    
+    return [UIImage imageNamed:imageName];
+}
+
+- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
+    NSString *text = NSLocalizedString(@"File_download_file_no_data",nil);
+    
+    NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:16.0f],
+                                 NSForegroundColorAttributeName: HW999999Color};
+    
+    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
+}
+
+//调整图片位置
+- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView {
+    return -150;
+}
+
 - (void)userCheckFilePreviewByRow:(NSInteger)row
 {
     if(row < _curCouldPhoneFileListMod.data.list.count){

+ 1 - 1
创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

@@ -361,4 +361,4 @@
 "File_backups_set_default_path_tip"   = "请停止备份操作后再更改路径";
 "File_download_Path_default"   = "下载路径  相册";
 "File_download_Path_default_done"   = "下载到:相册";
-
+"File_download_file_no_data"   = "暂无文件下载";