Skip to content

Commit 81796c2

Browse files
committed
.
1 parent 23608f7 commit 81796c2

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

Demo/Demo/Debug/Debug.storyboard

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@
251251
<nil key="textColor"/>
252252
<nil key="highlightedColor"/>
253253
</label>
254-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="PingFang" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cft-PD-lmZ">
255-
<rect key="frame" x="96.333333333333329" y="6" width="63.666666666666671" height="18"/>
254+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=".SFUI-Regular" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cft-PD-lmZ">
255+
<rect key="frame" x="96.333333333333314" y="6" width="95.666666666666686" height="18"/>
256256
<fontDescription key="fontDescription" type="system" pointSize="15"/>
257257
<color key="textColor" systemColor="placeholderTextColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
258258
<nil key="highlightedColor"/>

Demo/Demo/Debug/DebugLabelView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ extension DebugLabelView {
232232
func set(text: AttributedString) {
233233
// 富文本中如果包含段落样式 则无法进行多行字号缩放
234234
label.attributed.text = text
235+
// 刷新布局
235236
layoutIfNeeded()
236237
}
237238

Demo/Demo/Debug/DebugLabelViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class DebugLabelViewController: ViewController<DebugLabelView> {
3636
private var attributes: [AttributedString.Attribute] = []
3737
private var paragraphs: [AttributedString.Attribute.ParagraphStyle] = []
3838
private var attributedString: AttributedString = """
39-
我的名字叫李响,我的手机号码是18611401994,我的电子邮件地址是[email protected],现在是2020/06/28 20:30。我的GitHub主页是https://github.com/lixiang1994。欢迎来Star! \("点击联系我", .action({ }))
39+
我的名字叫李响,我的手机号码是18611401994,我的电子邮件地址是[email protected],现在是2020/06/28 20:30。我的GitHub主页是https://github.com/lixiang1994。欢迎来Star! \("点击联系我", .action({ }))
4040
"""
4141

4242
override func viewDidLoad() {

Sources/Extension/UIKit/UILabel/UILabelExtension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ extension UILabel {
450450
) { (value, range, stop) in
451451
guard let old = value as? NSParagraphStyle else { return }
452452
guard let new = old.mutableCopy() as? NSMutableParagraphStyle else { return }
453-
new.lineBreakMode = numberOfLines == 1 ? .byCharWrapping : .byWordWrapping
453+
new.lineBreakMode = .byWordWrapping
454454
if #available(iOS 11.0, *) {
455455
new.setValue(1, forKey: "lineBreakStrategy")
456456
}

0 commit comments

Comments
 (0)