You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/05/23 06:32:13 UTC
[05/10] incubator-weex git commit: + [ios] add border color width
RADIUS
+ [ios] add border color width RADIUS
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/aafe6a8f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/aafe6a8f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/aafe6a8f
Branch: refs/heads/0.13-dev
Commit: aafe6a8f1f8b77fa566851aa9bb90db0848abfb5
Parents: 32bc9c8
Author: 齐山 <su...@163.com>
Authored: Mon May 22 15:16:08 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Mon May 22 15:16:08 2017 +0800
----------------------------------------------------------------------
.../Sources/View/WXComponent+ViewManagement.m | 63 +++++++++++++++++---
1 file changed, 56 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/aafe6a8f/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
index da9db13..a4b20b8 100644
--- a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
+++ b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
@@ -30,7 +30,7 @@
do {\
if (styles && [styles containsObject:@#key]) {\
_borderTopLeftRadius = _borderTopRightRadius = _borderBottomLeftRadius = _borderBottomRightRadius = 0;\
- [self setNeedsLayout];\
+ [self setNeedsDisplay];\
}\
} while(0);
@@ -38,7 +38,39 @@ do {\
do {\
if (styles && [styles containsObject:@#key]) {\
_##key = 0;\
- [self setNeedsLayout];\
+ [self setNeedsDisplay];\
+ }\
+} while(0);
+
+#define WX_BOARD_WIDTH_RESET_ALL(key)\
+do {\
+ if (styles && [styles containsObject:@#key]) {\
+ _borderTopWidth = _borderLeftWidth = _borderRightWidth = _borderBottomWidth = 0;\
+ [self setNeedsDisplay];\
+ }\
+} while(0);
+
+#define WX_BOARD_WIDTH_RESET(key)\
+do {\
+ if (styles && [styles containsObject:@#key]) {\
+ _##key = 0;\
+ [self setNeedsLayout];\
+ }\
+} while(0);
+
+#define WX_BOARD_RADIUS_COLOR_RESET_ALL(key)\
+do {\
+ if (styles && [styles containsObject:@#key]) {\
+ _borderTopColor = _borderLeftColor = _borderRightColor = _borderBottomColor = [UIColor blackColor];\
+ [self setNeedsLayout];\
+ }\
+} while(0);
+
+#define WX_BOARD_COLOR_RESET(key)\
+do {\
+ if (styles && [styles containsObject:@#key]) {\
+ _##key = [UIColor blackColor];\
+ [self setNeedsDisplay];\
}\
} while(0);
@@ -215,6 +247,26 @@ do {\
}
}
+-(void)resetBorder:(NSArray *)styles
+{
+ WX_BOARD_RADIUS_RESET_ALL(borderRadius);
+ WX_BOARD_RADIUS_RESET(borderTopLeftRadius);
+ WX_BOARD_RADIUS_RESET(borderTopRightRadius);
+ WX_BOARD_RADIUS_RESET(borderBottomLeftRadius);
+ WX_BOARD_RADIUS_RESET(borderBottomRightRadius);
+
+ WX_BOARD_WIDTH_RESET_ALL(borderWidth);
+ WX_BOARD_WIDTH_RESET(borderTopWidth);
+ WX_BOARD_WIDTH_RESET(borderLeftWidth);
+ WX_BOARD_WIDTH_RESET(borderRightWidth);
+ WX_BOARD_WIDTH_RESET(borderBottomWidth);
+
+ WX_BOARD_RADIUS_COLOR_RESET_ALL(borderColor);
+ WX_BOARD_COLOR_RESET(borderTopColor);
+ WX_BOARD_COLOR_RESET(borderLeftColor);
+ WX_BOARD_COLOR_RESET(borderRightColor);
+ WX_BOARD_COLOR_RESET(borderBottomColor);
+}
-(void)_resetStyles:(NSArray *)styles
{
@@ -227,11 +279,8 @@ do {\
_boxShadow = nil;
[self setNeedsDisplay];
}
- WX_BOARD_RADIUS_RESET_ALL(borderRadius);
- WX_BOARD_RADIUS_RESET(borderTopLeftRadius);
- WX_BOARD_RADIUS_RESET(borderTopRightRadius);
- WX_BOARD_RADIUS_RESET(borderBottomLeftRadius);
- WX_BOARD_RADIUS_RESET(borderBottomRightRadius);
+
+ [self resetBorder:styles];
}
- (void)_unloadViewWithReusing:(BOOL)isReusing