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

Commit

Permalink
Fix default wordwrap (#2456)
Browse files Browse the repository at this point in the history
  • Loading branch information
wqyfavor authored and YorkShen committed May 17, 2019
1 parent bba6db7 commit da0c68c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm
Original file line number Diff line number Diff line change
Expand Up @@ -540,14 +540,13 @@ - (NSMutableAttributedString *)buildCTAttributeString
paragraphStyle.alignment = retAlign;
}

if ([[_wordWrap lowercaseString] isEqualToString:@"break-word"]) {
paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
} else if ([[_wordWrap lowercaseString] isEqualToString:@"normal"]){
paragraphStyle.lineBreakMode = NSLineBreakByClipping;
} else {
// set default lineBreakMode
if ([[_wordWrap lowercaseString] isEqualToString:@"anywhere"]) {
paragraphStyle.lineBreakMode = NSLineBreakByCharWrapping;
}
else {
paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
}

_truncationLine = NO;
if (_textOverflow && [_textOverflow length] > 0) {
if (_lines && [_textOverflow isEqualToString:@"ellipsis"])
Expand Down

0 comments on commit da0c68c

Please sign in to comment.