You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/12/13 03:27:42 UTC

[GitHub] wqyfavor closed pull request #1901: [iOS] [Bugfix] When navigation ishidden, the weexinstance will relayo…

wqyfavor closed pull request #1901: [iOS] [Bugfix] When navigation ishidden, the weexinstance will relayo…
URL: https://github.com/apache/incubator-weex/pull/1901
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm
index 114598cb98..b800a6ea8c 100644
--- a/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.mm
@@ -724,16 +724,15 @@ - (void)layoutComponent:(WXComponent*)component frame:(CGRect)frame isRTL:(BOOL)
     
     [component _setIsLayoutRTL:isRTL];
     if (component == _rootComponent) {
-        if (!CGSizeEqualToSize(frame.size, self.weexInstance.frame.size)) {
-            // Synchronize view frame with root component, especially for content wrap mode.
-            WXPerformBlockOnMainThread(^{
-                if (!self.weexInstance.isRootViewFrozen) {
-                    CGRect rect = self.weexInstance.rootView.frame; // no change of origin
-                    rect.size = frame.size;
-                    self.weexInstance.rootView.frame = rect;
-                }
-            });
-        }
+        // Synchronize view frame with root component, especially for content wrap mode.
+        WXPerformBlockOnMainThread(^{
+            if (!self.weexInstance.isRootViewFrozen &&
+                (!CGSizeEqualToSize(frame.size, self.weexInstance.frame.size) || !CGSizeEqualToSize(frame.size, self.weexInstance.rootView.frame.size))) {
+                CGRect rect = self.weexInstance.rootView.frame; // no change of origin
+                rect.size = frame.size;
+                self.weexInstance.rootView.frame = rect;
+            }
+        });
     }
     
     if ([component _isCalculatedFrameChanged:frame]) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services