2017-04-15 129 views
0


我使用DZNEmptyDataSet和重试按钮来处理网络不可达时的UIWebView。
这是我的添加按钮到一个UIWebView代码:隐藏UIWebView上的DZNEmptyDataSet

- (NSAttributedString *)buttonTitleForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state 
{ 
    NSString *text = @"Retry"; 
    UIFont *font = [UIFont systemFontOfSize:16.0]; 
    UIColor *textColor = [UIColor colorWithHex:(state == UIControlStateNormal) ? @"#40C141" : @"#c6def9" alpha:1.0]; 

    NSMutableDictionary *attributes = [NSMutableDictionary new]; 
    [attributes setObject:font forKey:NSFontAttributeName]; 
    [attributes setObject:textColor forKey:NSForegroundColorAttributeName]; 

    return [[NSAttributedString alloc] initWithString:text attributes:attributes]; 
} 

这是我对交接按钮的代码拍了拍:

- (void)emptyDataSet:(UIScrollView *)scrollView didTapButton:(UIButton *)button 
{ 
    self.failedLoading = NO; 
    [self.gameDetailWv reload]; 
} 

但DZNEmptyDataSet并不掩饰(我认为的UIWebView被DZEmptyDataSet重叠查看)当我点击按钮重新加载UIWebView。 我该怎么办?

回答

0

糟糕我意识到我的问题非常愚蠢。我必须使用的是让我的webview加载当前请求,而不是使用[webview reload]方法。
对不起,我的愚蠢答案。