From 2cd20b3ad7bdb473aba02309e87cdea2b8bf0ec5 Mon Sep 17 00:00:00 2001 From: wyh Date: Thu, 21 Jun 2018 15:00:42 +0800 Subject: [PATCH] Fix bug that super view maybe can't layout finish sometimes. --- WyhShowEmpty.podspec | 2 +- WyhShowEmpty/UIView+WyhShowEmpty.m | 5 +++++ WyhShowEmptyCategory.xcodeproj/project.pbxproj | 12 ++++++------ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/WyhShowEmpty.podspec b/WyhShowEmpty.podspec index f47b54c..5eafc4c 100644 --- a/WyhShowEmpty.podspec +++ b/WyhShowEmpty.podspec @@ -79,7 +79,7 @@ Pod::Spec.new do |s| # Supports git, hg, bzr, svn and HTTP. # - s.source = { :git => "https://github.com/XiaoWuTongZhi/WyhShowEmpty.git", :tag => "1.0.0" } + s.source = { :git => "https://github.com/XiaoWuTongZhi/WyhShowEmpty.git", :tag => "v1.0.0" } # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # diff --git a/WyhShowEmpty/UIView+WyhShowEmpty.m b/WyhShowEmpty/UIView+WyhShowEmpty.m index df34b98..a0b3d68 100644 --- a/WyhShowEmpty/UIView+WyhShowEmpty.m +++ b/WyhShowEmpty/UIView+WyhShowEmpty.m @@ -201,6 +201,11 @@ -(void)setupCoverViewPostionWithStyle:(WyhEmptyStyle *)style{ coverY = -64.0; /* 因为当某些导航栏透明效果影响,tableView的wrapperView起点会偏移64 */ } } + + // Fix masonry-autolayout + [style.superView setNeedsLayout]; + [style.superView layoutIfNeeded]; + superViewWidth = style.superView.wyh_w; superViewHeight = style.superView.wyh_h; diff --git a/WyhShowEmptyCategory.xcodeproj/project.pbxproj b/WyhShowEmptyCategory.xcodeproj/project.pbxproj index 82bb3de..bf9ccd1 100644 --- a/WyhShowEmptyCategory.xcodeproj/project.pbxproj +++ b/WyhShowEmptyCategory.xcodeproj/project.pbxproj @@ -131,18 +131,18 @@ 099FC8D320D8C12A00136BD9 /* WyhShowEmpty */ = { isa = PBXGroup; children = ( - 099FC8D420D8C12A00136BD9 /* UIView+WyhExtension.h */, 099FC8D520D8C12A00136BD9 /* WyhShowEmpty.h */, 099FC8D620D8C12A00136BD9 /* WyhShowEmptyConst.h */, - 099FC8D720D8C12A00136BD9 /* WyhEmptyStyle.m */, - 099FC8D820D8C12A00136BD9 /* UIView+WyhShowEmpty.m */, - 099FC8D920D8C12A00136BD9 /* UIViewController+WyhShowEmpty.m */, + 099FC8DD20D8C12A00136BD9 /* WyhShowEmptyConst.m */, + 099FC8D420D8C12A00136BD9 /* UIView+WyhExtension.h */, 099FC8DA20D8C12A00136BD9 /* UIView+WyhExtension.m */, - 099FC8DB20D8C12A00136BD9 /* WyhEmpty.bundle */, 099FC8DC20D8C12A00136BD9 /* WyhEmptyStyle.h */, - 099FC8DD20D8C12A00136BD9 /* WyhShowEmptyConst.m */, + 099FC8D720D8C12A00136BD9 /* WyhEmptyStyle.m */, 099FC8DE20D8C12A00136BD9 /* UIViewController+WyhShowEmpty.h */, + 099FC8D920D8C12A00136BD9 /* UIViewController+WyhShowEmpty.m */, 099FC8DF20D8C12A00136BD9 /* UIView+WyhShowEmpty.h */, + 099FC8D820D8C12A00136BD9 /* UIView+WyhShowEmpty.m */, + 099FC8DB20D8C12A00136BD9 /* WyhEmpty.bundle */, ); path = WyhShowEmpty; sourceTree = SOURCE_ROOT;