cxfeng1 closed pull request #1434: [WEEX-563][iOS] fix the attribute of linear-gradient on iOS URL: https://github.com/apache/incubator-weex/pull/1434
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/Utility/WXUtility.m b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m index e063395844..d0350551b6 100644 --- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m +++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m @@ -403,7 +403,11 @@ + (NSDictionary *)linearGradientWithBackgroundImage:(NSString *)backgroundImage if ([subStr hasPrefix:@"rgb"]) { gradientType = [WXConvert gradientType:gradientTypeStr]; - range = [subStr rangeOfString:@")"]; + if ([subStr containsString:@"%"]) { + range = [subStr rangeOfString:@"%"]; + } else { + range = [subStr rangeOfString:@")"]; + } NSString *startColorStr = [subStr substringToIndex:range.location + 1]; NSString *endColorStr = [subStr substringFromIndex:range.location + 2]; startColor = [WXConvert UIColor:startColorStr]; ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services