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。 我该怎么办?