Pārlūkot izejas kodu

remove discontinuous attributes when called `setText:`

ibireme 9 gadi atpakaļ
vecāks
revīzija
1263dcfc5e
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1 0
      YYText/YYLabel.m

+ 1 - 0
YYText/YYLabel.m

@@ -529,6 +529,7 @@ static dispatch_queue_t YYLabelGetReleaseQueue() {
     _text = text.copy;
     BOOL needAddAttributes = _innerText.length == 0 && text.length > 0;
     [_innerText replaceCharactersInRange:NSMakeRange(0, _innerText.length) withString:text ? text : @""];
+    [_innerText yy_removeDiscontinuousAttributesInRange:NSMakeRange(0, _innerText.length)];
     if (needAddAttributes) {
         _innerText.yy_font = _font ? _font : [self _defaultFont];
         _innerText.yy_color = _textColor;