Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

[WEEX-563][iOS] fix the attribute of linear-gradient on iOS #1434

Merged
merged 1 commit into from
Aug 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down