Is it possible to get a listing of attributes and ranges for an NSMutableAttributedString?

前端 未结 7 1320
小蘑菇
小蘑菇 2021-02-01 12:36

I\'ve created a method that takes a NSAttributedString and I\'m looking to dynamically create a subview and label to put the string into. Because attributes like font and size n

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-01 13:20

    Apple's Docs have a number of methods to access attributes:

    To retrieve attribute values from either type of attributed string, use any of these methods:

    attributesAtIndex:effectiveRange: attributesAtIndex:longestEffectiveRange:inRange: attribute:atIndex:effectiveRange: attribute:atIndex:longestEffectiveRange:inRange: fontAttributesInRange: rulerAttributesInRange:

提交回复
热议问题