Просмотр исходного кода

1.修改iOS UIScrollView EmptyView显示与隐藏。

Pen Li 7 лет назад
Родитель
Сommit
e02778b2da
2 измененных файлов с 7 добавлено и 2 удалено
  1. 5 1
      common/EmptyView/RAEmptyView.m
  2. 2 1
      common/UIScrollVIew+Empty/UIScrollView+Empty.m

+ 5 - 1
common/EmptyView/RAEmptyView.m

@@ -49,7 +49,11 @@
 - (UILabel *)tipLabel {
 - (UILabel *)tipLabel {
     if (!_tipLabel) {
     if (!_tipLabel) {
         _tipLabel = [[UILabel alloc] init];
         _tipLabel = [[UILabel alloc] init];
-        _tipLabel.text = NSLocalizedString(@"empty_tips", nil);
+        NSString *tips = NSLocalizedString(@"empty_tips", nil);
+        if ([tips isEqualToString:@"empty_tips"]) {
+            tips = @"Reload";
+        }
+        _tipLabel.text = tips;
         _tipLabel.numberOfLines = 0;
         _tipLabel.numberOfLines = 0;
         _tipLabel.textAlignment = NSTextAlignmentCenter;
         _tipLabel.textAlignment = NSTextAlignmentCenter;
     }
     }

+ 2 - 1
common/UIScrollVIew+Empty/UIScrollView+Empty.m

@@ -58,7 +58,7 @@ static const float duration = 0.25;
     UIView *view = [self emptyContentView];
     UIView *view = [self emptyContentView];
 //    view.alpha = 0.0f;
 //    view.alpha = 0.0f;
     view.hidden = NO;
     view.hidden = NO;
-    
+    [self bringSubviewToFront:view];
 //    [UIView animateWithDuration:duration animations:^{
 //    [UIView animateWithDuration:duration animations:^{
 //        view.alpha = 1.0f;
 //        view.alpha = 1.0f;
 //    }];
 //    }];
@@ -71,6 +71,7 @@ static const float duration = 0.25;
 //    } completion:^(BOOL finished) {
 //    } completion:^(BOOL finished) {
         view.hidden = YES;
         view.hidden = YES;
 //    }];
 //    }];
+    [self sendSubviewToBack:view];
 }
 }
 
 
 @end
 @end