From 3682eccffac943f4a322ae1efb32e485ab4aa7b9 Mon Sep 17 00:00:00 2001 From: Zhao Date: Thu, 27 Dec 2018 19:11:20 +0800 Subject: [PATCH] Fix DZNEmptyDataSetView width with horizontal insets --- Source/UIScrollView+EmptyDataSet.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/UIScrollView+EmptyDataSet.m b/Source/UIScrollView+EmptyDataSet.m index 27d0a3a7..5024d5ab 100644 --- a/Source/UIScrollView+EmptyDataSet.m +++ b/Source/UIScrollView+EmptyDataSet.m @@ -736,7 +736,8 @@ - (instancetype)init - (void)didMoveToSuperview { CGRect superviewBounds = self.superview.bounds; - self.frame = CGRectMake(0.0, 0.0, CGRectGetWidth(superviewBounds), CGRectGetHeight(superviewBounds)); + UIEdgeInsets insets = ((UIScrollView *)self.superview).contentInset; + self.frame = CGRectMake(0.0, 0.0, CGRectGetWidth(superviewBounds) - insets.right - insets.left, CGRectGetHeight(superviewBounds)); void(^fadeInBlock)(void) = ^{_contentView.alpha = 1.0;};