This is an automated email from the ASF dual-hosted git repository.

moshen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new 7793f07  [iOS] Fix dark scheme.
     new e629d29  Merge pull request #3061 from wqyfavor/fix-dark
7793f07 is described below

commit 7793f071ad27274b8a2a63d3d74ee1d018d94052
Author: qianyuan.wqy <[email protected]>
AuthorDate: Thu Dec 5 16:54:47 2019 +0800

    [iOS] Fix dark scheme.
---
 ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm 
b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
index cb6251c..a2dab80 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
@@ -406,31 +406,12 @@ static BOOL bNeedRemoveEvents = YES;
             _layer.borderWidth = _borderTopWidth;
             [self _resetNativeBorderRadius];
             _layer.opacity = _opacity;
-            
-            /* Also set background color to view to fix that problem that 
system may
-             set dynamic color to UITableView. Without these codes, event if 
we set
-             clear color to layer, the table view could not be transparent. */
+
             if ([WXUtility isDarkSchemeSupportEnabled]) {
                 UIColor* choosedColor = [self.weexInstance 
chooseColor:self.styleBackgroundColor 
lightSchemeColor:self.lightSchemeBackgroundColor 
darkSchemeColor:self.darkSchemeBackgroundColor invert:_invertForDarkScheme 
scene:[self colorSceneType]];
-                if (choosedColor == [UIColor clearColor]) {
-                    _view.backgroundColor = choosedColor;
-                }
-                _layer.backgroundColor = choosedColor.CGColor;
+                _view.backgroundColor = choosedColor;
             }
             else {
-                /* On iOS10, there is an annoying problem that if we only
-                 set backgroundColor to layer(not to view), for UIScrollView
-                 the background color would be black. So we have to set
-                 background color to UIView itself on iOS10(or lower).
-                 
-                 For iOS13, we have SDK which hooked setBackgroundColor
-                 of UIView to support autoinverting(no in WeexSDK).
-                 But that SDK would finally set a UIDynamicColor to view.
-                 Weex can handle dark mode, so we don't want background
-                 color of a UIView in Weex page to be set to UIDynamicColor.
-                 So in code above, we only set color to layer but which
-                 also caused the black problem that on iOS10.
-                 */
                 _view.backgroundColor = self.styleBackgroundColor;
             }
         }

Reply via email to